mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-06-28 09:50:05 +00:00
registration and verify abuse WIP
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m27s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m27s
This commit is contained in:
@ -6,6 +6,8 @@ from django_rest_passwordreset.signals import reset_password_token_created
|
||||
from django.db.models.signals import post_save
|
||||
from api.models import User
|
||||
from django.contrib.auth.models import Permission
|
||||
from api.tasks import verify_user_with_person_api_task
|
||||
from asgiref.sync import sync_to_async
|
||||
|
||||
|
||||
@receiver(post_save, sender=User)
|
||||
@ -26,6 +28,13 @@ def assign_device_permissions(sender, instance, created, **kwargs):
|
||||
instance.user_permissions.add(permission)
|
||||
|
||||
|
||||
@receiver(post_save, sender=User)
|
||||
@sync_to_async
|
||||
def verify_user_with_person_api(sender, instance, created, **kwargs):
|
||||
if created:
|
||||
verify_user_with_person_api_task(instance.id)
|
||||
|
||||
|
||||
@receiver(reset_password_token_created)
|
||||
def password_reset_token_created(
|
||||
sender, instance, reset_password_token, *args, **kwargs
|
||||
|
Reference in New Issue
Block a user