From 75949cb01c4118542944ae80eb5b38c5122dbee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Fri, 17 Feb 2017 12:06:07 +0100 Subject: [PATCH] Fixed IntegrityError while creating groups with postgres (Fixed #2960). Use ng-submit for group form template. --- openslides/users/signals.py | 8 ++++---- openslides/users/static/templates/users/group-edit.html | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/openslides/users/signals.py b/openslides/users/signals.py index d9e9afa25..56799d6c1 100644 --- a/openslides/users/signals.py +++ b/openslides/users/signals.py @@ -66,7 +66,7 @@ def create_builtin_groups_and_admin(**kwargs): permission_dict['mediafiles.can_see'], permission_dict['motions.can_see'], permission_dict['users.can_see_name'], ) - group_default = Group.objects.create(name='Default', pk=1) + group_default = Group.objects.create(name='Default') group_default.permissions.add(*base_permissions) # Delegates (pk 2) @@ -85,7 +85,7 @@ def create_builtin_groups_and_admin(**kwargs): permission_dict['motions.can_create'], permission_dict['motions.can_support'], permission_dict['users.can_see_name'], ) - group_delegates = Group.objects.create(name='Delegates', pk=2) + group_delegates = Group.objects.create(name='Delegates') group_delegates.permissions.add(*delegates_permissions) # Staff (pk 3) @@ -116,7 +116,7 @@ def create_builtin_groups_and_admin(**kwargs): permission_dict['users.can_manage'], permission_dict['users.can_see_extra_data'], permission_dict['mediafiles.can_see_hidden'],) - group_staff = Group.objects.create(name='Staff', pk=3) + group_staff = Group.objects.create(name='Staff') group_staff.permissions.add(*staff_permissions) # Add users.can_see_name permission to staff @@ -139,7 +139,7 @@ def create_builtin_groups_and_admin(**kwargs): permission_dict['motions.can_create'], permission_dict['motions.can_support'], permission_dict['users.can_see_name'], ) - group_committee = Group.objects.create(name='Committees', pk=4) + group_committee = Group.objects.create(name='Committees') group_committee.permissions.add(*committees_permissions) # Create or reset admin user diff --git a/openslides/users/static/templates/users/group-edit.html b/openslides/users/static/templates/users/group-edit.html index 935c5a2a9..fdd3e7cd9 100644 --- a/openslides/users/static/templates/users/group-edit.html +++ b/openslides/users/static/templates/users/group-edit.html @@ -3,6 +3,8 @@
{{ alert.msg }}
+ +