X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/2cd938606837981b7a3914458ae0071828ef37ca..867558658970caca66b302d87976e6dfe2cfc09c:/contact/admin.py diff --git a/contact/admin.py b/contact/admin.py index 5ddf831..ee1623d 100644 --- a/contact/admin.py +++ b/contact/admin.py @@ -7,7 +7,7 @@ from django.template import Template from django.utils.safestring import mark_safe -class ContactAdminMeta(admin.ModelAdmin.__metaclass__): +class ContactAdminMeta(admin.ModelAdmin.__class__): def __getattr__(cls, name): if name.startswith('admin_list_'): return lambda self: "" @@ -21,6 +21,7 @@ class ContactAdmin(admin.ModelAdmin): ["admin_list_%d" % i for i in range(admin_list_width)] fields = ['form_tag', 'created_at', 'contact', 'ip'] readonly_fields = ['form_tag', 'created_at', 'contact', 'ip'] + list_filter = ['form_tag'] def admin_list(self, obj, nr): try: @@ -28,7 +29,7 @@ class ContactAdmin(admin.ModelAdmin): except BaseException, e: return '' else: - return obj.body.get(field_name, 'y') + return obj.body.get(field_name, '') def __getattr__(self, name): if name.startswith('admin_list_'):