Fixed IntegrityError while creating groups with postgres (Fixed #2960).
Use ng-submit for group form template.
This commit is contained in:
parent
0319799aff
commit
75949cb01c
@ -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
|
||||
|
@ -3,6 +3,8 @@
|
||||
<div uib-alert ng-show="alert.show" class="alert-danger" ng-click="alert={}" close="alert={}">
|
||||
{{ alert.msg }}
|
||||
</div>
|
||||
|
||||
<form name="groupForm" ng-submit="save()">
|
||||
<label for="name_1">
|
||||
<span ng-if="group">
|
||||
<translate>Please enter a new name for {{ group.name }}:</translate>
|
||||
@ -16,7 +18,7 @@
|
||||
<input class="form-control" id="name_1" type="text" ng-model="new_name">
|
||||
</div>
|
||||
<div class="spacer-top-lg">
|
||||
<button ng-click="save()" ng-disabled="new_name == ''" class="btn btn-primary" translate>
|
||||
<button type="submit" ng-disabled="new_name == ''" class="btn btn-primary" translate>
|
||||
Save
|
||||
</button>
|
||||
<button ng-click="closeThisDialog()" class="btn btn-default" translate>
|
||||
@ -24,3 +26,4 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user