Allow to configure length of ticket secret

This commit is contained in:
Raphael Michel
2021-05-19 18:04:02 +02:00
parent 9809b88b52
commit 9773867f92
5 changed files with 30 additions and 2 deletions

View File

@@ -461,6 +461,32 @@ DEFAULTS = {
'default': 'random',
'type': str,
},
'ticket_secret_length': {
'default': settings.ENTROPY['ticket_secret'],
'type': int,
'form_class': forms.IntegerField,
'serializer_class': serializers.IntegerField,
'serializer_kwargs': dict(
validators=[
MinValueValidator(12),
MaxValueValidator(64),
]
),
'form_kwargs': dict(
label=_('Length of ticket codes'),
validators=[
MinValueValidator(12),
MaxValueValidator(64),
],
widget=forms.NumberInput(
attrs={
'min': '12',
'max': '64',
'data-display-dependency': 'input[name=ticket_secret_generator][value=random]',
},
),
)
},
'reservation_time': {
'default': '30',
'type': int,