push_notifications: Simplify if device exists checks.

This commit is contained in:
Hashir Sarwar
2020-07-16 19:54:49 +05:00
committed by Tim Abbott
parent 981d028411
commit b885678881
3 changed files with 9 additions and 9 deletions

View File

@@ -166,11 +166,9 @@ def remote_server_notify_push(request: HttpRequest, entity: Union[UserProfile, R
server=server,
))
if android_devices:
send_android_push_notification(android_devices, gcm_payload, gcm_options, remote=True)
send_android_push_notification(android_devices, gcm_payload, gcm_options, remote=True)
if apple_devices:
send_apple_push_notification(user_id, apple_devices, apns_payload, remote=True)
send_apple_push_notification(user_id, apple_devices, apns_payload, remote=True)
return json_success()