Admin app raises exception, if GFK referenced object has been deleted.
h2he opened this issue · 0 comments
h2he commented
--- admin.py.orig 2015-03-04 13:39:24.040388839 +0200
+++ admin.py 2015-03-04 13:40:32.153011770 +0200
@@ -18,7 +18,11 @@
class EmailConfirmationAdmin(admin.ModelAdmin):
def show_content_type(self, obj):
- return obj.content_object._meta.object_name
+ return (
+ obj.content_object._meta.object_name
+ if obj.content_object
+ else None
+ )