mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
users: Fix marking first boot step as done
This commit is contained in:
parent
f457a0bdd3
commit
0fdc0ffe52
@ -27,6 +27,7 @@ from django.utils.translation import ugettext as _, ugettext_lazy
|
|||||||
|
|
||||||
from plinth import actions
|
from plinth import actions
|
||||||
from plinth.errors import ActionError
|
from plinth.errors import ActionError
|
||||||
|
from plinth.modules import first_boot
|
||||||
from plinth.modules.security import set_restricted_access
|
from plinth.modules.security import set_restricted_access
|
||||||
|
|
||||||
# Usernames used by optional services (that might not be installed yet).
|
# Usernames used by optional services (that might not be installed yet).
|
||||||
@ -256,6 +257,8 @@ class FirstBootForm(ValidNewUsernameCheckMixin, auth.forms.UserCreationForm):
|
|||||||
"""Create and log the user in."""
|
"""Create and log the user in."""
|
||||||
user = super().save(commit=commit)
|
user = super().save(commit=commit)
|
||||||
if commit:
|
if commit:
|
||||||
|
first_boot.mark_step_done('users_firstboot')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
actions.superuser_run(
|
actions.superuser_run(
|
||||||
'ldap',
|
'ldap',
|
||||||
|
|||||||
@ -179,13 +179,6 @@ class FirstBootView(django.views.generic.CreateView):
|
|||||||
kwargs['request'] = self.request
|
kwargs['request'] = self.request
|
||||||
return kwargs
|
return kwargs
|
||||||
|
|
||||||
def form_valid(self, form):
|
|
||||||
"""Mark this first boot step as completed and save form."""
|
|
||||||
if User.objects.all():
|
|
||||||
first_boot.mark_step_done('users_firstboot')
|
|
||||||
|
|
||||||
return super().form_valid(form)
|
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
"""Return the next first boot step after valid form submission."""
|
"""Return the next first boot step after valid form submission."""
|
||||||
return reverse(first_boot.next_step())
|
return reverse(first_boot.next_step())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user