django2.2: replace removed is_anonymous() and is_authenticated to their now used counterparts

This commit is contained in:
2019-10-06 01:34:21 +02:00
parent 90921fd4cd
commit 97c316b62e
11 changed files with 22 additions and 22 deletions

View File

@ -150,7 +150,7 @@ class CanCreateMixin(View):
def dispatch(self, request, *arg, **kwargs):
res = super(CanCreateMixin, self).dispatch(request, *arg, **kwargs)
if not request.user.is_authenticated():
if not request.user.is_authenticated:
raise PermissionDenied
return res

View File

@ -289,7 +289,7 @@ class FileView(CanViewMixin, DetailView, FormMixin):
self.form = self.get_form() # The form handle only the file upload
files = request.FILES.getlist("file_field")
if (
request.user.is_authenticated()
request.user.is_authenticated
and request.user.can_edit(self.object)
and self.form.is_valid()
):

View File

@ -689,7 +689,7 @@ class UserUpdateProfileView(UserTabsMixin, CanEditMixin, UpdateView):
files = request.FILES.items()
self.form.process(files)
if (
request.user.is_authenticated()
request.user.is_authenticated
and request.user.can_edit(self.object)
and self.form.is_valid()
):