This commit is contained in:
Jędrzej Klepacki 2021-01-26 18:08:01 +01:00
parent d5ca4e0acc
commit f792c1c8cf
4 changed files with 11 additions and 5 deletions

View File

@ -64,9 +64,15 @@ def Notificationuser_deletenot(request, not_id):
def Notificationuser_deleteuser(request, user_id): def Notificationuser_deleteuser(request, user_id):
if request.user.is_authenticated and request.user.is_superuser == True: if request.user.is_authenticated and request.user.is_superuser == True:
User = get_user_model() User = get_user_model()
instance = User.objects.get(id=user_id) instant = User.objects.get(id=user_id)
instance.is_active = False instant.is_active = False
instance.save() 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') messages.success(request, 'Użytkownik Usunięty')
return redirect(UserPage) return redirect(UserPage)
else: else:

View File

@ -42,7 +42,7 @@
<div class="container h-100"> <div class="container h-100">
<div class="row h-100 justify-content-center align-items-center"> <div class="row h-100 justify-content-center align-items-center">
<div class="col-10 col-md-8 col-lg-6"> <div class="col-10 col-md-8 col-lg-6">
<input type="submit" class="btn btn-primary update_btn" value="Dodaj Komentarz"> <input type="submit" class="btn btn-primary update_btn" value="Zgłoś">
</div> </div>
</div> </div>
</div> </div>

View File

@ -41,7 +41,7 @@
<div class="container h-100"> <div class="container h-100">
<div class="row h-100 justify-content-center align-items-center"> <div class="row h-100 justify-content-center align-items-center">
<div class="col-10 col-md-8 col-lg-6"> <div class="col-10 col-md-8 col-lg-6">
<input type="submit" class="btn btn-primary update_btn" value="Dodaj Komentarz"> <input type="submit" class="btn btn-primary update_btn" value="Zgłoś">
</div> </div>
</div> </div>
</div> </div>