parent
6cb3259683
commit
b3a791ef8f
|
@ -28,3 +28,8 @@ class Authentic2Config(AppConfig):
|
|||
def ready(self):
|
||||
plugins.init()
|
||||
debug.HIDDEN_SETTINGS = re.compile('API|TOKEN|KEY|SECRET|PASS|PROFANITIES_LIST|SIGNATURE|LDAP')
|
||||
|
||||
# register convertes
|
||||
from authentic2.utils.converters import register_converters
|
||||
|
||||
register_converters()
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# Authentic2 © Entr'ouvert
|
||||
|
||||
from django.urls.converters import SlugConverter, register_converter
|
||||
|
||||
|
||||
class ObjectUUID:
|
||||
regex = r'[0-9a-f]{32}'
|
||||
|
||||
def to_python(self, value):
|
||||
return value.replace('-', '')
|
||||
|
||||
def to_url(self, value):
|
||||
return str(value)
|
||||
|
||||
|
||||
def register_converters():
|
||||
register_converter(ObjectUUID, 'a2_uuid')
|
||||
# legacy, some instances have non UUID like string as User.uuid
|
||||
register_converter(SlugConverter, 'user_uuid')
|
Loading…
Reference in New Issue