mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Fix the resource_url method when a model primary key is a models.UUIDField, we need to consider use the object_pk in this case.
This commit is contained in:
parent
f456dedb5f
commit
38ec7de585
2 changed files with 6 additions and 4 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -1,7 +1,9 @@
|
|||
*.db
|
||||
*.egg-info
|
||||
*.log
|
||||
*.pot
|
||||
*.pyc
|
||||
*.db
|
||||
local_settings.py
|
||||
.pydevproject
|
||||
.idea
|
||||
.project
|
||||
.pydevproject
|
||||
local_settings.py
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class LogEntryAdminMixin(object):
|
|||
def resource_url(self, obj):
|
||||
app_label, model = obj.content_type.app_label, obj.content_type.model
|
||||
viewname = 'admin:%s_%s_change' % (app_label, model)
|
||||
link = urlresolvers.reverse(viewname, args=[obj.object_id])
|
||||
link = urlresolvers.reverse(viewname, args=[obj.object_id or obj.object_pk])
|
||||
return u'<a href="%s">%s</a>' % (link, obj.object_repr)
|
||||
resource_url.allow_tags = True
|
||||
resource_url.short_description = 'Resource'
|
||||
|
|
|
|||
Loading…
Reference in a new issue