Skip to content

Commit

Permalink
[#1042] Added support role for Users
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Mar 9, 2015
1 parent 586bf00 commit 3e80889
Show file tree
Hide file tree
Showing 3 changed files with 617 additions and 3 deletions.
6 changes: 3 additions & 3 deletions akvo/rsr/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ class UserAdmin(UserAdmin):
(None, {'fields': ('username', 'email', 'password')}),
(_('Personal info'), {'fields': ('first_name', 'last_name')}),
(_('Permissions'), {
'fields': ('is_active', 'is_staff', 'is_admin', 'is_superuser')
'fields': ('is_active', 'is_staff', 'is_admin', 'is_support', 'is_superuser')
}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
Expand All @@ -834,7 +834,7 @@ class UserAdmin(UserAdmin):
)
list_display = (
'username', 'email', 'get_organisation_names', 'get_full_name', 'get_is_active', 'get_is_admin',
'latest_update_date'
'get_is_support', 'latest_update_date'
)
search_fields = ('username', 'email', 'first_name', 'last_name')
ordering = ('username',)
Expand All @@ -843,7 +843,7 @@ def get_readonly_fields(self, request, obj=None):
if request.user.is_superuser:
return ['last_login', 'date_joined']
else:
return ['is_admin', 'is_superuser', 'last_login', 'date_joined']
return ['is_admin', 'is_support', 'is_superuser', 'last_login', 'date_joined']

def get_queryset(self, request):
if request.user.is_superuser or request.user.is_admin:
Expand Down
Loading

0 comments on commit 3e80889

Please sign in to comment.