a
    Lcòfî  ã                   @   sH   d dl Z d dlmZmZmZ d dlmZ d dlmZ G dd„ deƒZ	dS )é    N)Úmail_adminsÚmail_managersÚ	send_mail)ÚBaseCommand)Útimezonec                   @   s$   e Zd ZdZdZdd„ Zdd„ ZdS )ÚCommandzASends a test email to the email addresses specified as arguments.zRYou must specify some email recipients, or pass the --managers or --admin options.c                 C   s4   |j dddd� |j dddd� |j d	dd
d� d S )NÚemailÚ*z4One or more email addresses to send a test email to.)ÚnargsÚhelpz
--managersÚ
store_truezBSend a test email to the addresses specified in settings.MANAGERS.)Úactionr   z--adminsz@Send a test email to the addresses specified in settings.ADMINS.)Úadd_argument)ÚselfÚparser© r   új/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/django/core/management/commands/sendtestemail.pyÚadd_arguments   s    ýýýzCommand.add_argumentsc                 O   sP   dt  ¡ t ¡ f }t|dd |d d� |d r:t|dƒ |d rLt|dƒ d S )	NzTest email from %s on %sz*If you're reading this, it was successful.r   )ÚsubjectÚmessageZ
from_emailZrecipient_listZmanagersz)This email was sent to the site managers.Zadminsz'This email was sent to the site admins.)ÚsocketÚgethostnamer   Únowr   r   r   )r   ÚargsÚkwargsr   r   r   r   Úhandle    s    ü
zCommand.handleN)Ú__name__Ú
__module__Ú__qualname__r   Zmissing_args_messager   r   r   r   r   r   r      s
   ÿr   )
r   Zdjango.core.mailr   r   r   Zdjango.core.management.baser   Zdjango.utilsr   r   r   r   r   r   Ú<module>   s   