mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
Create initial django groups during first_boot.
This commit is contained in:
parent
dbd4dff52e
commit
fcc37a8e28
@ -23,6 +23,7 @@ from gettext import gettext as _
|
|||||||
from plinth import actions
|
from plinth import actions
|
||||||
from plinth.errors import ActionError
|
from plinth.errors import ActionError
|
||||||
from plinth.modules.config import config
|
from plinth.modules.config import config
|
||||||
|
from plinth.modules.users.forms import GROUP_CHOICES
|
||||||
|
|
||||||
|
|
||||||
class State0Form(forms.ModelForm):
|
class State0Form(forms.ModelForm):
|
||||||
@ -81,8 +82,11 @@ than 63 characters in length.'),
|
|||||||
messages.error(self.request,
|
messages.error(self.request,
|
||||||
_('Failed to add new user to admin group.'))
|
_('Failed to add new user to admin group.'))
|
||||||
|
|
||||||
g = auth.models.Group.objects.create(name='admin')
|
# create initial Django groups
|
||||||
g.user_set.add(user)
|
for group_choice in GROUP_CHOICES:
|
||||||
|
auth.models.Group.objects.create(name=group_choice[0])
|
||||||
|
admin_group = auth.models.Group.objects.get(name='admin')
|
||||||
|
admin_group.user_set.add(user)
|
||||||
|
|
||||||
self.login_user()
|
self.login_user()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user