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

News moderation email magic links #1600

Merged
merged 9 commits into from
Jan 15, 2025
Merged

News moderation email magic links #1600

merged 9 commits into from
Jan 15, 2025

Conversation

GregKaleka
Copy link
Collaborator

@GregKaleka GregKaleka commented Jan 15, 2025

  • Email is sent to individual moderators rather than one group email
  • Email is HTML with txt fallback
  • Email contains magic link to approve news entry without requiring login
    • Link expires 24h after it's generated
  • Graceful handling of case where news item has already been approved by another moderator
  • Non-magic moderation link now redirects to login page instead of 404ing for unauthenticated users

Here's what the email looks like:

Screenshot 2025-01-15 at 12 23 37 PM

Fixes #1586

@rbbeeston
Copy link
Member

Looks good, But let's change the expiration to 1 day. ok to merge once that is done and Dave signs off on it

@rbbeeston
Copy link
Member

One note about the "Decline" button - we had some discussions and at least for this iteration we are not going to implement it, and it would significantly increase the scope of the project, and would leave other questions unanswered.

Specifically:

  1. Currently there is no way to flag an item that's declined, there is only a delete function. so if an item is mistakenly removed, it's gone forever. Safer for the time being to have only an approve. Ignoring an item will simply keep it off the site.

  2. As an option, items that are not approved could auto delete after an amount of time, say 1 week could be auto deleted.

  3. Setting up a means to decline without deleting would be a larger project, and there would need to be discussions on process, for example, if one mod approved and another declined, what would be the outcome?

Considering these issues, we are going to move forward with the current solution, and create a new issue if it's decided that more needs to be done.


from .acl import moderators

User = get_user_model()
NEWS_APPROVAL_SALT = "news-approval"
Copy link
Collaborator

@daveoconnor daveoconnor Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing: I'd move these to the constants file


def test_generate_magic_approval_link(make_entry, make_user):
entry = make_entry()
# entry = make_entry(NEWS_MODELS[0])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: this comment could be removed.

Copy link
Collaborator

@daveoconnor daveoconnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of very small things, otherwise looks good to go.

@GregKaleka GregKaleka merged commit 7468f54 into develop Jan 15, 2025
4 checks passed
@GregKaleka GregKaleka deleted the gk/issue-1586 branch January 15, 2025 19:54
daveoconnor pushed a commit that referenced this pull request Mar 8, 2025
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.

Moderation requests should rederect to login
3 participants