mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
groups: Consistent listing of groups
- Remove conditional registration of groups on module initialization. - Create uninitialized groups on addition/update of groups for user. - Remove group creation on setup/installation of a module. Tested for: - Multi registration of groups. - Manual UI test to check visibility of groups irrespective of whether module is installed/enabled. Signed-off-by: Aakanksha Saini <aakanksa@thoughtworks.com> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
834737d9dc
commit
0dea420ffe
7 files changed
+47
-13
No files matched your search
@@ -109,6 +109,7 @@ class CreateUserForm(ValidNewUsernameCheckMixin, UserCreationForm):
|
||||
|
||||
for group in self.cleaned_data['groups']:
|
||||
try:
|
||||
users.create_group(group)
|
||||
actions.superuser_run('users', [
|
||||
'add-user-to-group',
|
||||
user.get_username(), group
|
||||
@@ -205,6 +206,7 @@ class UserUpdateForm(ValidNewUsernameCheckMixin, forms.ModelForm):
|
||||
for new_group in new_groups:
|
||||
if new_group not in old_groups:
|
||||
try:
|
||||
users.create_group(new_group)
|
||||
actions.superuser_run('users', [
|
||||
'add-user-to-group',
|
||||
user.get_username(), new_group
|
||||
|
||||
Reference in new issue
Block a user