mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-26 18:03:28 +01:00
Merge pull request #380 from powderflask/Fix-user_admin_url
Fix: _meta.module_name deprecated in django1.8
This commit is contained in:
commit
b8c08b7699
@ -14,8 +14,13 @@ from django.contrib.auth import get_user_model
|
||||
|
||||
def user_admin_url(action):
|
||||
user = get_user_model()
|
||||
try:
|
||||
model_name = user._meta.module_name.lower()
|
||||
except AttributeError: # module_name alias removed in django 1.8
|
||||
model_name = user._meta.model_name.lower()
|
||||
|
||||
return 'admin:%s_%s_%s' % (
|
||||
user._meta.app_label, user._meta.module_name.lower(),
|
||||
user._meta.app_label, model_name,
|
||||
action)
|
||||
|
||||
register = template.Library()
|
||||
|
Loading…
Reference in New Issue
Block a user