Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes permissions problem from proxy class #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions fluent_comments/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion fluent_comments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down