mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Move updating user validation out of validate_and_update_broadcast_message_status
As only 1 of 2 functions calling it needs that check, it's better to perform it inside that 1 function.
This commit is contained in:
@@ -111,7 +111,7 @@ def _cancel_or_reject_broadcast(references_to_original_broadcast, service_id):
|
||||
message="Broadcast message reference and service id didn't match with any existing broadcasts",
|
||||
status_code=404,
|
||||
)
|
||||
# do we need to check if service is active?
|
||||
|
||||
if broadcast_message.status == BroadcastStatusType.PENDING_APPROVAL:
|
||||
new_status = BroadcastStatusType.REJECTED
|
||||
else:
|
||||
@@ -119,8 +119,7 @@ def _cancel_or_reject_broadcast(references_to_original_broadcast, service_id):
|
||||
validate_and_update_broadcast_message_status(
|
||||
broadcast_message,
|
||||
new_status,
|
||||
updating_user=None,
|
||||
from_api=True
|
||||
updating_user=None
|
||||
)
|
||||
return broadcast_message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user