From 9ee2b2f9ac42fd5871cc1619bad55313e616252c Mon Sep 17 00:00:00 2001 From: dogstick Date: Sun, 6 Apr 2014 15:01:08 +0100 Subject: [PATCH 1/2] fixes permissions issue from proxy --- fluent_comments/admin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fluent_comments/admin.py b/fluent_comments/admin.py index f417197..250db91 100644 --- a/fluent_comments/admin.py +++ b/fluent_comments/admin.py @@ -78,6 +78,12 @@ def user_name_col(self, comment): def has_add_permission(self, request): return False + def has_change_permission(self, request, obj=None): + return request.user.has_perm('comments.change_fluentcomment') + + def has_delete_permission(self, request, obj=None): + return request.user.has_perm('comments.delete_fluentcomment') + def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == 'title': kwargs['widget'] = AdminTextInputWidget From e9846d7f6f0d7741faa19b28a6bfa76d6434a5c0 Mon Sep 17 00:00:00 2001 From: dogstick Date: Sun, 6 Apr 2014 19:15:15 +0100 Subject: [PATCH 2/2] added app label for proxy permissions --- fluent_comments/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fluent_comments/models.py b/fluent_comments/models.py index 98a7d0d..9e71832 100644 --- a/fluent_comments/models.py +++ b/fluent_comments/models.py @@ -28,7 +28,8 @@ class FluentComment(Comment): class Meta: proxy = True - + app_label = 'comments' + @receiver(signals.comment_was_posted) def on_comment_posted(sender, comment, request, **kwargs):