mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-10-31 02:32:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			353 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			353 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from app import hashids
 | |
| from werkzeug.routing import BaseConverter
 | |
| from .models import Permission
 | |
| 
 | |
| 
 | |
| class HashidConverter(BaseConverter):
 | |
|     def to_python(self, value):
 | |
|         return hashids.decode(value)[0]
 | |
| 
 | |
|     def to_url(self, value):
 | |
|         return hashids.encode(value)
 | |
| 
 | |
| 
 | |
| def permission_context_processor():
 | |
|     return {'Permission': Permission}
 |