-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add admin action to mark snippet as spam or inappropiate #100
Conversation
cab/admin.py
Outdated
|
||
def mark_as_inappropiate(self, request, queryset): | ||
for obj in queryset: | ||
if not obj.flags.all(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider the case where a user/admin has marked a snippet as inappropriate and it later gets marked as spam or vice versa? If so, this is not supported.
Although it looks like the intention was for more than one user to be able to flag snippets as spam or inappropriate so maybe the if not obj.flags.all()
check is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi sorry I have taken so long to get back to you , I completely missed this.Thanks for the PR. Will go through it this week 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think the intent is that multiple users can mark it as spam so we wont need the check.
Happy to have an inappropriate flag :)
9261fc6
to
2a50730
Compare
djangosnippets/settings/base.py
Outdated
@@ -77,6 +83,7 @@ def user_url(user): | |||
'django.contrib.messages.middleware.MessageMiddleware', | |||
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', | |||
'ratelimitbackend.middleware.RateLimitMiddleware', | |||
'debug_toolbar.middleware.DebugToolbarMiddleware', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The django-debug-toolbar settings in the base.py file are problematic for our production settings.
Your pull request has flagged this issue and I will raise a separate issue that sorts this out as it will be a good edition. Could you remove DDTB from the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why that was showing up but it has been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a quick glance this looks good. Thanks @santos22
See #74
Open to feedback!