diff options
author | Dan McGee <dan@archlinux.org> | 2011-11-22 16:16:54 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2013-09-30 20:53:53 -0500 |
commit | c72ccd6c83312537d740300d0ff27da5cf94833a (patch) | |
tree | 47ba294e595efdd8e70bc245624094f0a856140a | |
parent | 160e1efaadff58efbe92ed98cbec75ab04689d70 (diff) | |
download | archweb-c72ccd6c83312537d740300d0ff27da5cf94833a.tar.gz archweb-c72ccd6c83312537d740300d0ff27da5cf94833a.zip |
WIP: master keys in archweb
-rw-r--r-- | main/models.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py index 2ace0109..9b90bf58 100644 --- a/main/models.py +++ b/main/models.py @@ -13,6 +13,18 @@ from .utils import set_created_field from devel.models import DeveloperKey from packages.alpm import AlpmAPI + def get_absolute_url(self): + # TODO: this is disgusting. find a way to consolidate this logic with + # public.views.userlist among other places, and make some constants or + # something so we aren't using copies of string names everywhere. + group_names = self.user.groups.values_list('name', flat=True) + if "Developers" in group_names: + prefix = "developers" + elif "Trusted Users" in group_names: + prefix = "trustedusers" + else: + prefix = "fellows" + return '/%s/#%s' % (prefix, self.user.username) class PackageManager(models.Manager): def flagged(self): |