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

@@ -13,7 +13,7 @@ from app.models import (
)
def validate_and_update_broadcast_message_status(broadcast_message, new_status, updating_user=None, api_key_id=None):
def validate_and_update_broadcast_message_status(broadcast_message, new_status, updating_user):
if new_status not in BroadcastStatusType.ALLOWED_STATUS_TRANSITIONS[broadcast_message.status]:
raise InvalidRequest(
f'Cannot move broadcast_message {broadcast_message.id} from {broadcast_message.status} to {new_status}',
@@ -39,7 +39,6 @@ def validate_and_update_broadcast_message_status(broadcast_message, new_status,
if new_status == BroadcastStatusType.CANCELLED:
broadcast_message.cancelled_at = datetime.utcnow()
broadcast_message.cancelled_by = updating_user
broadcast_message.cancelled_by_api_key_id = api_key_id
current_app.logger.info(
f'broadcast_message {broadcast_message.id} moving from {broadcast_message.status} to {new_status}'