mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-07-10 11:36:30 +00:00
refactor(api): change async functions to synchronous for user verification task 🔨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 6m8s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 6m8s
This commit is contained in:
@ -29,9 +29,9 @@ def assign_device_permissions(sender, instance, created, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
@receiver(post_save, sender=User)
|
@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:
|
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)
|
@receiver(reset_password_token_created)
|
||||||
|
@ -69,8 +69,7 @@ def add_new_devices_to_omada(new_devices: list[dict]):
|
|||||||
omada_client.add_new_devices_to_omada(new_devices)
|
omada_client.add_new_devices_to_omada(new_devices)
|
||||||
|
|
||||||
|
|
||||||
@app.task
|
def verify_user_with_person_api_task(user_id: int):
|
||||||
async def verify_user_with_person_api_task(user_id: int):
|
|
||||||
"""
|
"""
|
||||||
Verify the user with the Person API.
|
Verify the user with the Person API.
|
||||||
:param user_id: The ID of the user to verify.
|
:param user_id: The ID of the user to verify.
|
||||||
|
Reference in New Issue
Block a user