Skip to content

Commit

Permalink
Fix _meta.module_name removal in Django 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
treyhunner committed Apr 14, 2014
1 parent 326bf46 commit de3eda6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion simple_history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,12 @@ def get_extra_fields(self, model, fields):
@models.permalink
def revert_url(self):
opts = model._meta
try:
app_label, model_name = opts.app_label, opts.module_name
except AttributeError:
app_label, model_name = opts.app_label, opts.model_name
return ('%s:%s_%s_simple_history' %
(admin.site.name, opts.app_label, opts.module_name),
(admin.site.name, app_label, model_name),
[getattr(self, opts.pk.attname), self.history_id])

def get_instance(self):
Expand Down

0 comments on commit de3eda6

Please sign in to comment.