o
    ?dh5&                     @   sj   d Z ddlZddlmZ ddlmZ ddlmZmZ e	dZ
eeeddd	 Zeeedd
d ZdS )zAccounts Signals

This module contains Django signals for the accounts app.
Signals handle automatic actions when certain events occur.
    N)	post_save)receiver)ProfileUserzadtlas.accounts)senderc                 K   s   |rt jj|d dS dS )z
    Signal to automatically create a Profile when a User is created.
    
    This ensures every user has an associated profile without manual intervention.
    )userN)r   objectscreate)r   instancecreatedkwargs r   IC:\Users\vibe-look\OneDrive\Desktop\Adtlas_V\src\apps\accounts\signals.pycreate_user_profile   s   r   c                 K   s   t |dr|j  dS dS )z
    Signal to save the Profile when the User is saved.
    
    This ensures the profile is always kept in sync with the user.
    profileN)hasattrr   save)r   r
   r   r   r   r   save_user_profile&   s   
r   )__doc__loggingZdjango.db.models.signalsr   django.dispatchr   Zapps.accounts.modelsr   r   	getLoggerloggerr   r   r   r   r   r   <module>   s    



	