Commits

Trey Hunner  committed ee78138 Draft

Fix SimpleHistoryAdmin for Django 1.4 compatibility

  • Participants
  • Parent commits 8f5afd1

Comments (0)

Files changed (1)

File simple_history/admin.py

             'action_list': action_list,
             'module_name': capfirst(force_unicode(opts.verbose_name_plural)),
             'object': obj,
-            'root_path': self.admin_site.root_path,
+            'root_path': getattr(self.admin_site, 'root_path', None),
             'app_label': app_label,
+            'opts': opts
         }
         context.update(extra_context or {})
         context_instance = template.RequestContext(request, current_app=self.admin_site.name)
             'content_type_id': ContentType.objects.get_for_model(self.model).id,
             'save_as': self.save_as,
             'save_on_top': self.save_on_top,
-            'root_path': self.admin_site.root_path,
+            'root_path': getattr(self.admin_site, 'root_path', None),
         }
         context_instance = template.RequestContext(request, current_app=self.admin_site.name)
         return render_to_response(self.object_history_form_template, context, context_instance)