misc: RemovedInDjango20Warning is_authenticated and is_anonymous (#39438)

RemovedInDjango20Warning: Using user.is_authenticated() and user.is_anonymous()
as a method is deprecated. Remove the parentheses to use it as an attribute.
This commit is contained in:
Lauréline Guérin 2020-01-31 11:00:11 +01:00
parent d217767257
commit f2807ce2ec
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 1 additions and 1 deletions

View File

@ -890,7 +890,7 @@ class TransactionStatusApiView(View):
except (Transaction.DoesNotExist, ValueError):
return HttpResponseNotFound(_('Unknown transaction.'))
user = request.user if request.user.is_authenticated() else None
user = request.user if request.user.is_authenticated else None
error_msg = _('Transaction does not belong to the requesting user')
if user and transaction.user and user != transaction.user:
return HttpResponseForbidden(error_msg)