Skip to content

Commit

Permalink
moderation: handle system actions for the community flow
Browse files Browse the repository at this point in the history
* Fixes a bug occuring when the moderation handlers run for community
  updates during system actions (e.g. when an admin accepts a
  subcommunity inclusion request).
  • Loading branch information
slint committed Nov 15, 2024
1 parent 58c9ba1 commit 6230fca
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 6230fca

Please sign in to comment.