Saturday, August 24, 2019

Re: reload the page and the logged in user converted to the admin


request.user there is a current user, but if I reload the page, the currennt user converted to the admin ?
Enter code here...
def countries_rate(request):
auth_user = request.user
if request.user.is_authenticated:
auth_user = request.user
if (user_rate.objects.filter(user_id=auth_user).delete()):
print(auth_user,' OK deleted ----------------.................')
formset = countriesFormset(request.POST or None)


Not sure if it's related, but is there a reason you immediately delete the logged-in user as soon as the page loads? Even before any forms are submitted?

-James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciUTY%3DyMCqqRVQWPQyaq7%3D7D2-Zs-3wNK0HfH%2BCXRURkAQ%40mail.gmail.com.

No comments:

Post a Comment