Skip to content

Commit

Permalink
Prevent redundant update statement when creating a report
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal committed Apr 21, 2023
1 parent 5879bc1 commit 2944aae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/catalog/api/models/media.py
Expand Up @@ -268,7 +268,10 @@ def save(self, *args, **kwargs):
)
if self.status != DEINDEXED:
same_reports = same_reports.filter(reason=self.reason)
same_reports.update(status=self.status)

# Prevent redundant update statement when creating the report
if self.status != PENDING:
same_reports.update(status=self.status)


class AbstractDeletedMedia(OpenLedgerModel):
Expand Down

0 comments on commit 2944aae

Please sign in to comment.