Skip to content

Commit

Permalink
Merge pull request #287 from bsvetchine/devel
Browse files Browse the repository at this point in the history
Removed In Django 1.8 | model._meta.module_name replaced by model._meta....
  • Loading branch information
lukaszb committed Feb 24, 2015
2 parents af822d7 + 79f1b66 commit 4fc68d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions guardian/admin.py
@@ -1,5 +1,6 @@
from __future__ import unicode_literals

import django
from django import forms
from django.conf import settings
from guardian.compat import url, patterns
Expand Down Expand Up @@ -85,7 +86,6 @@ def get_queryset(self, request):
# Allow queryset method as fallback for Django versions < 1.6
# for versions >= 1.6 this is taken care of by Django itself
# and triggers a warning message automatically.
import django
if django.VERSION < (1, 6):
queryset = get_queryset

Expand All @@ -104,7 +104,12 @@ def get_urls(self):
"""
urls = super(GuardedModelAdminMixin, self).get_urls()
if self.include_object_permissions_urls:
info = self.model._meta.app_label, self.model._meta.module_name
# model._meta.module_name is deprecated in django version 1.7 and removed in django version 1.8.
# It is replaced by model._meta.model_name
if django.VERSION < (1, 7):
info = self.model._meta.app_label, self.model._meta.module_name
else:
info = self.model._meta.app_label, self.model._meta.model_name
myurls = patterns('',
url(r'^(?P<object_pk>.+)/permissions/$',
view=self.admin_site.admin_view(self.obj_perms_manage_view),
Expand Down

0 comments on commit 4fc68d5

Please sign in to comment.