dav_auth: test if autogenerated password actually are configurable
Run tests / Execute tox to run the test suite (push) Successful in 3m40s
Run tests / Execute tox to run the test suite (push) Successful in 3m40s
This commit is contained in:
+4
-5
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user