Skip to content

Commit ffcc644

Browse files
committed
Skip creation of default permissions for history models in django 1.7 onward
1 parent 8820c6e commit ffcc644

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

audit_log/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = (0, 4, 0, 'final')
1+
VERSION = (0, 5, 0, 'final')
22

33
if VERSION[-1] != "final": # pragma: no cover
44
__version__ = '.'.join(map(str, VERSION))

audit_log/models/managers.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AuditLog(object):
5656

5757
def __init__(self, exclude = []):
5858
self._exclude = exclude
59-
59+
6060
def contribute_to_class(self, cls, name):
6161
self.manager_name = name
6262
models.signals.class_prepared.connect(self.finalize, sender = cls)
@@ -180,10 +180,14 @@ def get_meta_options(self, model):
180180
Returns a dictionary of Meta options for the
181181
autdit log model.
182182
"""
183-
return {
183+
result = {
184184
'ordering' : ('-action_date',),
185185
'app_label' : model._meta.app_label,
186186
}
187+
from django.db.models.options import DEFAULT_NAMES
188+
if 'default_permissions' in DEFAULT_NAMES:
189+
result.update({'default_permissions': ()})
190+
return result
187191

188192
def create_log_entry_model(self, model):
189193
"""

0 commit comments

Comments
 (0)