Skip to content

Commit d5c7985

Browse files
committed
Removed history_user link from change admin page
1 parent ef6d4dd commit d5c7985

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

simple_history/admin.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@
1919
from django.utils.encoding import force_text
2020
except ImportError: # django 1.3 compatibility
2121
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))
2922

3023

3124
class SimpleHistoryAdmin(admin.ModelAdmin):
@@ -60,10 +53,6 @@ def history_view(self, request, object_id, extra_context=None):
6053
action_list = history.filter(**{pk_name: object_id})
6154
# If no history was found, see whether this object even exists.
6255
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)
6756
context = {
6857
'title': _('Change history: %s') % force_text(obj),
6958
'action_list': action_list,
@@ -72,7 +61,6 @@ def history_view(self, request, object_id, extra_context=None):
7261
'root_path': getattr(self.admin_site, 'root_path', None),
7362
'app_label': app_label,
7463
'opts': opts,
75-
'admin_user_view': admin_user_view
7664
}
7765
context.update(extra_context or {})
7866
context_instance = template.RequestContext(

simple_history/templates/simple_history/object_history.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<td>{{ action.get_history_type_display }}</td>
2929
<td>
3030
{% if action.history_user %}
31-
<a href="{% url admin_user_view action.history_user_id %}">{{ action.history_user }}</a>
31+
{{ action.history_user }}
3232
{% else %}
3333
None
3434
{% endif %}

0 commit comments

Comments
 (0)