Skip to content

Commit

Permalink
Programmatically infer pg trigger URI from model name
Browse files Browse the repository at this point in the history
  • Loading branch information
superbuggy committed Dec 13, 2024
1 parent 1c3bc36 commit 7a52b45
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions osidb/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,17 +541,8 @@ def unembargo(self):
model_audit = apps.get_model(db, model_name).objects.filter(
pgh_id=ref.pgh_id
)
with pgtrigger.ignore(
"osidb.FlawAudit:append_only",
"osidb.SnippetAudit:append_only",
"osidb.AffectAudit:append_only",
"osidb.AffectCVSSAudit:append_only",
"osidb.TrackerAudit:append_only",
"osidb.FlawAcknowledgmentAudit:append_only",
"osidb.FlawCommentAudit:append_only",
"osidb.FlawCVSSAudit:append_only",
"osidb.FlawReferenceAudit:append_only",
):

with pgtrigger.ignore(f"{db}.{model_name}:append_only"):
model_audit.update(
acl_read=list(self.acls_public_read),
acl_write=list(self.acls_public_write),
Expand Down

0 comments on commit 7a52b45

Please sign in to comment.