Compare commits

..

No commits in common. "fce719aca1a6362383af64a4a31cdf6bc82fce8c" and "4d82c76fbd6ee5152a90768dc120c42060ed1525" have entirely different histories.

3 changed files with 1 additions and 14 deletions

View File

@ -1,11 +1,6 @@
Changelog Changelog
========= =========
0.8.10
-----
* New templatetag to check if user has role
0.8.9 0.8.9
----- -----

View File

@ -5,7 +5,6 @@ from django import template
from django.utils.html import mark_safe from django.utils.html import mark_safe
from ..sites import site from ..sites import site
from ..models import UserRole
register = template.Library() register = template.Library()
@ -60,10 +59,3 @@ def pagination(request, page):
@register.filter @register.filter
def to_json(data): def to_json(data):
return mark_safe(json.dumps(data)) return mark_safe(json.dumps(data))
@register.filter
def has_role(user, role):
if user.is_superuser:
return True
return UserRole.objects.filter(role__in=(role, "admins"), user=user).exists()

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = django-gas name = django-gas
version = 0.8.10 version = 0.8.9
description = An alternative to django admin description = An alternative to django admin
long_description = file: readme.md, changelog.md, collaborators.md long_description = file: readme.md, changelog.md, collaborators.md
long_description_content_type = text/markdown long_description_content_type = text/markdown