From 35384ef049c4ba5907c8e6f7bef5052a4196edc2 Mon Sep 17 00:00:00 2001 From: i701 Date: Tue, 8 Jul 2025 22:57:43 +0500 Subject: [PATCH] =?UTF-8?q?refactor(api):=20change=20async=20functions=20t?= =?UTF-8?q?o=20synchronous=20for=20user=20verification=20task=20?= =?UTF-8?q?=F0=9F=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/signals.py | 4 ++-- api/tasks.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api/signals.py b/api/signals.py index 3af45b7..0355edb 100644 --- a/api/signals.py +++ b/api/signals.py @@ -29,9 +29,9 @@ def assign_device_permissions(sender, instance, created, **kwargs): @receiver(post_save, sender=User) -async def verify_user_with_person_api(sender, instance, created, **kwargs): +def verify_user_with_person_api(sender, instance, created, **kwargs): if created: - await verify_user_with_person_api_task.defer_async(instance.id) + verify_user_with_person_api_task(instance.id) @receiver(reset_password_token_created) diff --git a/api/tasks.py b/api/tasks.py index 343f858..9a7f703 100644 --- a/api/tasks.py +++ b/api/tasks.py @@ -69,8 +69,7 @@ def add_new_devices_to_omada(new_devices: list[dict]): omada_client.add_new_devices_to_omada(new_devices) -@app.task -async def verify_user_with_person_api_task(user_id: int): +def verify_user_with_person_api_task(user_id: int): """ Verify the user with the Person API. :param user_id: The ID of the user to verify.