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

Add admin action to mark snippet as spam or inappropiate #100

Merged
merged 3 commits into from
Aug 8, 2020

Conversation

santos22
Copy link
Contributor

See #74

Open to feedback!

cab/admin.py Outdated

def mark_as_inappropiate(self, request, queryset):
for obj in queryset:
if not obj.flags.all():
Copy link
Contributor Author

@santos22 santos22 Mar 28, 2020

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.

Copy link
Collaborator

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 👍

Copy link
Collaborator

@chriswedgwood chriswedgwood Jul 29, 2020

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 :)

@@ -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',
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Member

@carltongibson carltongibson left a 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

@chriswedgwood chriswedgwood merged commit 818e742 into django:master Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants