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

Moderation-related fixes #1064

Merged
merged 3 commits into from
Nov 15, 2024
Merged
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: 3 additions & 3 deletions scripts/deploy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env python
import sys
import subprocess
import sys
from pathlib import Path


PROGRAM = Path(sys.argv[0]).name
ENVS = {
"dev": "zenodo-rdm-dev",
Expand All @@ -17,11 +16,12 @@
"worker-low": ["worker-low"],
"worker-spam": ["worker-spam"],
"worker-beat": ["worker-beat"],
"terminal": ["terminal"],
"worker-beat-custom": ["worker-beat-custom"],
"terminal": ["terminal"],
}
deployment_names = ", ".join(DEPLOYMENTS.keys())


def _abort(message):
print(message)
sys.exit(1)
Expand Down
3 changes: 2 additions & 1 deletion site/zenodo_rdm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def domains_cli():


@domains_cli.command("add")
@click.option("-d", "--domain", required=True, help="The domain to add.")
@click.option("-d", "--domain", help="The domain to add.")
@click.option("-n", "--notes", help="Additional notes for the domain.")
@click.option(
"-s",
Expand All @@ -396,6 +396,7 @@ def domains_cli():
@with_appcontext
def add_domain(domain, notes, status, score, file):
"""Command to add a moderated links domain."""
assert domain or file, "You must provide either a single domain or a CSV file."
if file:
_add_domains_from_csv(file)
else:
Expand Down
3 changes: 3 additions & 0 deletions site/zenodo_rdm/moderation/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ def __init__(self):

def _run(self, identity, record, uow):
"""Run the moderation scoring."""
# Skip moderation for system actions (e.g. subcommunity inclusion actions)
if identity == system_identity:
return
user = UserAggregate.get_record(identity.id)

# Perform the moderation checks asynchronously for verified users
Expand Down