Commit 1bb31103 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Resolve minor deprecated features

parent 3e54607b
......@@ -192,13 +192,13 @@ class UserInfoView(RetrieveAPIView):
#def get_serializer_class(self):
# # Override so we can use custom behavior for unauthenticated users
# if self.request.user.is_anonymous():
# if self.request.user.is_anonymous:
# return AnonymousUserSerializer
# else:
# return self.serializer_class
def retrieve(self, request, *args, **kwargs):
if request.user.is_anonymous():
if request.user.is_anonymous:
output = {'username': 'AnonymousUser'}
else:
instance = request.user
......
......@@ -109,7 +109,7 @@ class AutoIncrementModel(models.Model):
query = models.sql.InsertQuery(self.__class__)
query.insert_values(fields, objs=[self])
compiler = query.get_compiler(using=self.__class__._base_manager.db)
compiler.return_id = meta.has_auto_field and not pk_set
compiler.return_id = meta.auto_field is not None and not pk_set
# Useful function
qn = compiler.quote_name_unless_alias
......
......@@ -131,7 +131,7 @@ def to_png_image(out = sys.stdout):
@internal_user_required
def cbc_report(request, format=""):
if not request.user or not request.user.is_authenticated():
if not request.user or not request.user.is_authenticated:
return HttpResponseForbidden("Forbidden")
if request.method == "GET":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment