Skip to content

Commit

Permalink
Merge pull request #1060 from boxwise/warn-when-multi-base-agreement-…
Browse files Browse the repository at this point in the history
…created

Emit warning to Sentry when multi-base agreement created
  • Loading branch information
HaGuesto authored Oct 18, 2023
2 parents 56145fa + 3d47404 commit 0b62764
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import timezone as dtimezone

from peewee import fn
from sentry_sdk import capture_message as emit_sentry_message

from ....db import db
from ....enums import TransferAgreementState, TransferAgreementType
Expand Down Expand Up @@ -221,6 +222,18 @@ def create_transfer_agreement(
for t in target_base_ids
]
TransferAgreementDetail.insert_many(details_data).execute()

if len(source_base_ids) > 1 or len(target_base_ids) > 1:
emit_sentry_message(
"Created multi-base agreement",
level="warning",
extras={
"transfer_agreement_id": transfer_agreement.id,
"source_base_ids": list(source_base_ids),
"target_base_ids": list(target_base_ids),
},
)

return transfer_agreement


Expand Down

0 comments on commit 0b62764

Please sign in to comment.