dav_auth: test if autogenerated password actually are configurable
Run tests / Execute tox to run the test suite (push) Successful in 3m40s

This commit is contained in:
2026-05-28 17:22:04 +02:00
parent 50a33a9f47
commit 6c7b349a8c
2 changed files with 23 additions and 7 deletions
+4 -5
View File
@@ -79,14 +79,13 @@ class CreateAndSendPasswordView(generic.FormView):
form_class = forms.CreateAndSendPasswordForm
template_name = 'dav_auth/forms/recreate_password.html'
success_url = reverse_lazy('dav_auth:login')
password_length = app_config.settings.auto_password_length
password_chars = app_config.settings.auto_password_characters
def _create_new_password(self, length=None, characters=None):
@staticmethod
def _create_new_password(length=None, characters=None):
if length is None:
length = self.password_length
length = app_config.settings.auto_password_length
if characters is None:
characters = self.password_chars
characters = app_config.settings.auto_password_characters
return ''.join(secrets.choice(characters) for i in range(length))
def form_valid(self, form):