From 4ba4863a9801848e4c6edc8de2f4c643a1e5659d Mon Sep 17 00:00:00 2001 From: Simon Caminada Date: Thu, 15 Mar 2018 14:05:35 +0100 Subject: [PATCH] bug fixes --- .gitignore | 5 +++- src/project/admin.py | 56 -------------------------------------------- 2 files changed, 4 insertions(+), 57 deletions(-) diff --git a/.gitignore b/.gitignore index 8cc9699..dacc552 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,7 @@ Thumbs.db /static/css/ /static/js/ /static/fonts/ -/static/img/ \ No newline at end of file +/static/img/ +/static/animation/ +/whoosh/ +/.idea \ No newline at end of file diff --git a/src/project/admin.py b/src/project/admin.py index 3269617..ba9cf19 100644 --- a/src/project/admin.py +++ b/src/project/admin.py @@ -17,59 +17,3 @@ class ImageExtensionAdmin(PageExtensionAdmin): @admin.register(SliderItemQualification) class SliderItemQualificationAdmin(TranslatableAdmin): pass - - -# https://djangosnippets.org/snippets/2484/ -@admin.register(LogEntry) -class LogEntryAdmin(admin.ModelAdmin): - date_hierarchy = 'action_time' - - readonly_fields = LogEntry._meta.get_all_field_names() - - list_filter = [ - 'user', - 'content_type', - 'action_flag' - ] - - search_fields = [ - 'object_repr', - 'change_message' - ] - - list_display = [ - 'action_time', - 'user', - 'content_type', - 'object_link', - 'action_flag', - 'change_message', - ] - - def has_add_permission(self, request): - return False - - def has_change_permission(self, request, obj=None): - return request.user.is_superuser and request.method != 'POST' - - def has_delete_permission(self, request, obj=None): - return False - - def object_link(self, obj): - if obj.action_flag == DELETION: - link = escape(obj.object_repr) - else: - ct = obj.content_type - link = u'%s' % ( - reverse('admin:%s_%s_change' % (ct.app_label, ct.model), args=[obj.object_id]), - escape(obj.object_repr), - ) - return link - - object_link.allow_tags = True - object_link.admin_order_field = 'object_repr' - object_link.short_description = u'object' - - def queryset(self, request): - return super(LogEntryAdmin, self).queryset(request) \ - .prefetch_related('content_type')