diff --git a/SocialHelper/control/__pycache__/views.cpython-37.pyc b/SocialHelper/control/__pycache__/views.cpython-37.pyc index 5439a55..b9f4594 100644 Binary files a/SocialHelper/control/__pycache__/views.cpython-37.pyc and b/SocialHelper/control/__pycache__/views.cpython-37.pyc differ 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 @@