Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
abarolo authored and abarolo committed Oct 16, 2024
1 parent 6a37e65 commit 6c39394
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 3 additions & 7 deletions api/dataset/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from datetime import datetime

from dateutil.relativedelta import relativedelta
from django.contrib.auth import get_user_model
from hawkrest import HawkAuthentication
from rest_framework import generics
Expand Down Expand Up @@ -63,9 +60,8 @@ class UserList(generics.ListAPIView):
permission_classes = (IsAuthenticated,)

def get_queryset(self):
return (
UserModel.objects.values("id", "email", "first_name", "last_name", "last_login")
.order_by("id")
)
return UserModel.objects.values(
"id", "email", "first_name", "last_name", "last_login"
).order_by("id")

serializer_class = UserSerializer
6 changes: 4 additions & 2 deletions tests/dataset/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from api.barriers.models import Barrier
from api.collaboration.models import TeamMember
from api.core.test_utils import APITestMixin, create_simple_user, create_test_user
from api.core.test_utils import APITestMixin, create_test_user
from api.feedback.models import Feedback
from api.metadata.constants import (
FEEDBACK_FORM_ATTEMPTED_ACTION_ANSWERS,
Expand Down Expand Up @@ -297,7 +297,9 @@ def test_base_user(self):

response = self.api_client.get(url)

assert response.data["results"][0]["last_login"] == ts1.strftime("%Y-%m-%dT%H:%M:%SZ")
assert response.data["results"][0]["last_login"] == ts1.strftime(
"%Y-%m-%dT%H:%M:%SZ"
)

def test_user_added(self):
create_test_user()
Expand Down

0 comments on commit 6c39394

Please sign in to comment.