From f792c1c8cf8f6efe682410d2f253a6bf833cd159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Klepacki?= Date: Tue, 26 Jan 2021 18:08:01 +0100 Subject: [PATCH] push --- .../control/__pycache__/views.cpython-37.pyc | Bin 6916 -> 7069 bytes SocialHelper/control/views.py | 12 +++++++++--- .../templates/homepage/offer_note.html | 2 +- .../templates/homepage/user_note.html | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/SocialHelper/control/__pycache__/views.cpython-37.pyc b/SocialHelper/control/__pycache__/views.cpython-37.pyc index 5439a55668644ed57e4249f8c75022b69570a2ad..b9f4594c65a53458c487765f7deb9badac118d56 100644 GIT binary patch delta 839 zcmZ`$&rcIU6rQ)+ZFjf3?UpT;0*yv4^dQv`B^nb20SP~fP{d#~b(3u)6%eOuLU4(R z=*6H1-^GgvXT6xc7&RvT0p86f9=vGc#cW465sOVO|~KVQX|$-d~l^Fupzs$FIVGU z!j~KBCJ3(m$8|3$w1zLcF`&;!YHFEGO7|ELrAaV55tR2)XWR{`T@%E;FDQ|+$x3lZ={kWRk9>LA=3PU z3EWGc&)+*B!DKLQH31&s$4nlkf-jj8z!a+X2t32GU4YqO$?gJ}#g?bkLK3?FI-wIageC+E<~Ir_BN ztY^xO>tJ8Dgnx2l=O_j5BA_5YO>l<5A}A9?~#BrF8q rIvzv+DETiEj1i0zOb|>GMDLp=Hct@UzJS}E6+5FQRb5O%Gn&R)+AcBGXPy&Sn8Y!X^5+H@484$dX0Th%B zObDi%Kw@BFLoHYg?LW}D>Qc38rIvxMow{`5&IG|wKl!73_r1G!cc-cS2{UIHS{HrG z*UIXz!Ao;fRb;x#coiP9rKVJqYf2NU(h=-=s-C82#oP4Y&p;B}hKy-n3d>dxZuDvR zHlpA+BZ6OiR*x)3sm9mtMtxnZys3&Ye6J5-QT4~!lOe5c5xO7*UNGrbK?hY58T_Q| z;H~z-E^>_Ci7`QwRLPP=7Eb~nv84|~77wfhzR(Q(p$FhK{?={Ck-AHLZIk-fD8Z`h z&AT-}oA2z}e`^*f>kkyDUIrR&#*A}g)xm0U_+y&`c;UC5z24^lvv?LPz#-lS`=R70 zp%}m%Zds9Mvy>uygoM}KfS6~;7^8?w;gR?;ne`CiVRRae7SI{L?3{(;&_7M`IR~0g z0y`U+cE0z8L0upv0b&vV*=zLna-^N+ED>YOF(w&P3?4zeWVoGm-*=W~$9-pPy~0>@ x7_KlM9fyju8$EzzhW%Maj*({+7&8oa)Dl}|hWmO2Q?W|WuliMu4%2Xteg|`=d+GoH diff --git a/SocialHelper/control/views.py b/SocialHelper/control/views.py index 72889da..f1f2adc 100644 --- a/SocialHelper/control/views.py +++ b/SocialHelper/control/views.py @@ -64,9 +64,15 @@ def Notificationuser_deletenot(request, not_id): def Notificationuser_deleteuser(request, user_id): if request.user.is_authenticated and request.user.is_superuser == True: User = get_user_model() - instance = User.objects.get(id=user_id) - instance.is_active = False - instance.save() + instant = User.objects.get(id=user_id) + instant.is_active = False + instant.email = str(instant.id) + instant.username = str(instant.id) + instant_offer = Product.objects.filter(user_iden = instant) + for offer in instant_offer: + offer.active = False + offer.save() + instant.save() messages.success(request, 'Użytkownik Usunięty') return redirect(UserPage) else: diff --git a/SocialHelper/homepage/templates/homepage/offer_note.html b/SocialHelper/homepage/templates/homepage/offer_note.html index fa9fb8d..289f57d 100644 --- a/SocialHelper/homepage/templates/homepage/offer_note.html +++ b/SocialHelper/homepage/templates/homepage/offer_note.html @@ -42,7 +42,7 @@
- +
diff --git a/SocialHelper/homepage/templates/homepage/user_note.html b/SocialHelper/homepage/templates/homepage/user_note.html index 539e008..d64a06e 100644 --- a/SocialHelper/homepage/templates/homepage/user_note.html +++ b/SocialHelper/homepage/templates/homepage/user_note.html @@ -41,7 +41,7 @@
- +