mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-24 17:04:25 +01:00
Fix: _meta.module_name deprecated in django1.8
This commit is contained in:
parent
4347d1ec61
commit
8bf3449719
@ -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