o
    wvXjÓ  ã                   @   sL   d Z ddlmZ ddlmZ ejZeedejƒZdd„ Z	dd„ Z
d	d
„ ZdS )z
Utilities.é    )Úsettings)ÚtimezoneÚtemplate_localtimec                 C   sZ   t tddƒrt | ¡rt | tj¡} t ¡ }t | |¡} | S t | ¡r+t | t ¡ ¡} | S )z,Force datatime to have timezone information.ÚUSE_TZF)Úgetattrr   r   Úis_naiveÚ
make_awareÚutcÚget_default_timezoneÚ	localtime)ÚvalueÚ
default_tz© r   úU/var/www/html/myproject/venv/lib/python3.10/site-packages/django_celery_beat/utils.pyr      s   

þr   c                   C   s    t tddƒrtt ¡ ƒS t ¡ S )z!Return the current date and time.r   F)r   r   Únow_localtimer   Únowr   r   r   r   r      s   r   c                 C   s6   | sdS ddl m} ddlm} | dkpt|| ƒ|ƒS )z<Return true if Celery is configured to use the db scheduler.Fr   )Úsymbol_by_nameé   )ÚDatabaseSchedulerÚdjango)Úkombu.utilsr   Ú
schedulersr   Ú
issubclass)Ú	schedulerr   r   r   r   r   Úis_database_scheduler%   s   þr   N)Ú__doc__Údjango.confr   Údjango.utilsr   Úis_awarer   r   r   r   r   r   r   r   r   r   Ú<module>   s    