19
19
from django .utils .encoding import force_text
20
20
except ImportError : # django 1.3 compatibility
21
21
from django .utils .encoding import force_unicode as force_text
22
- from django .conf import settings
23
-
24
- try :
25
- USER_NATURAL_KEY = settings .AUTH_USER_MODEL
26
- except AttributeError :
27
- USER_NATURAL_KEY = "auth.User"
28
- USER_NATURAL_KEY = tuple (key .lower () for key in USER_NATURAL_KEY .split ('.' , 1 ))
29
22
30
23
31
24
class SimpleHistoryAdmin (admin .ModelAdmin ):
@@ -60,10 +53,6 @@ def history_view(self, request, object_id, extra_context=None):
60
53
action_list = history .filter (** {pk_name : object_id })
61
54
# If no history was found, see whether this object even exists.
62
55
obj = get_object_or_404 (model , pk = object_id )
63
- content_type = ContentType .objects .get_by_natural_key (
64
- * USER_NATURAL_KEY )
65
- admin_user_view = 'admin:%s_%s_change' % (content_type .app_label ,
66
- content_type .model )
67
56
context = {
68
57
'title' : _ ('Change history: %s' ) % force_text (obj ),
69
58
'action_list' : action_list ,
@@ -72,7 +61,6 @@ def history_view(self, request, object_id, extra_context=None):
72
61
'root_path' : getattr (self .admin_site , 'root_path' , None ),
73
62
'app_label' : app_label ,
74
63
'opts' : opts ,
75
- 'admin_user_view' : admin_user_view
76
64
}
77
65
context .update (extra_context or {})
78
66
context_instance = template .RequestContext (
0 commit comments