Revert "Audit api key id when cancelling broadcast via api"

This commit is contained in:
Pea Tyczynska
2022-02-09 11:01:39 +00:00
committed by GitHub
parent d05bff9efc
commit a780933893
6 changed files with 25 additions and 154 deletions

View File

@@ -2322,17 +2322,15 @@ class BroadcastMessage(db.Model):
approved_by = db.relationship('User', foreign_keys=[approved_by_id])
cancelled_by = db.relationship('User', foreign_keys=[cancelled_by_id])
created_by_api_key_id = db.Column(UUID(as_uuid=True), db.ForeignKey('api_keys.id'), nullable=True)
cancelled_by_api_key_id = db.Column(UUID(as_uuid=True), db.ForeignKey('api_keys.id'), nullable=True)
created_by_api_key = db.relationship('ApiKey', foreign_keys=[created_by_api_key_id])
cancelled_by_api_key = db.relationship('ApiKey', foreign_keys=[cancelled_by_api_key_id])
api_key_id = db.Column(UUID(as_uuid=True), db.ForeignKey('api_keys.id'), nullable=True)
api_key = db.relationship('ApiKey')
reference = db.Column(db.String(255), nullable=True)
cap_event = db.Column(db.String(255), nullable=True)
stubbed = db.Column(db.Boolean, nullable=False)
CheckConstraint("created_by_id is not null or created_by_api_key_id is not null")
CheckConstraint("created_by_id is not null or api_key_id is not null")
@property
def personalisation(self):