Skip to content
Snippets Groups Projects
Commit 13d8e4fb authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Changed UserAccount to provide access to Admin panel.

Added has_perm() and has_module_perm() to UserAccount model. Both return is_superuser . This allows superusers to access AdminPanel.

AdminPanel now displays usernames in User ListView.
parent e20a64a0
No related branches found
No related tags found
1 merge request!15Refactor
Pipeline #
This commit is part of merge request !15. Comments created here will be created in the context of that merge request.
......@@ -58,7 +58,7 @@ class UserAdmin(BaseUserAdmin):
# The fields to be used in displaying the User model.
# These override the definitions on the base UserAdmin
# that reference specific fields on auth.User.
list_display = ('is_admin',)
list_display = ('username', 'is_admin',)
list_filter = ('is_admin',)
fieldsets = (
(None, {'fields': ('password',)}),
......
......@@ -203,6 +203,12 @@ class UserAccount(AbstractBaseUser):
USERNAME_FIELD = 'username'
def has_perm(self, *args):
return self.is_superuser
def has_module_perms(self, *args):
return self.is_superuser
def get_associated_user(self):
""" Returns the user type that is associated with this user obj """
return \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment