Skip to content

Commit

Permalink
Merge branch 'development' into portal-frontend-51
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos authored Sep 19, 2024
2 parents 29caa6c + e4ec5fb commit f4628a9
Show file tree
Hide file tree
Showing 14 changed files with 438 additions and 457 deletions.
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name = "pypi"
# 5. Run `pipenv install --dev` in your terminal.

[packages]
codeforlife = {ref = "v0.18.7", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"}
codeforlife = {ref = "v0.18.12", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"}
# 🚫 Don't add [packages] below that are inherited from the CFL package.
pyjwt = "==2.6.0" # TODO: upgrade to latest version
# TODO: Needed by RR. Remove when RR has moved to new system.
Expand All @@ -32,9 +32,9 @@ django-sekizai = "==2.0.0"
django-classy-tags = "==2.0.0"

[dev-packages]
codeforlife = {ref = "v0.18.7", git = "https://github.com/ocadotechnology/codeforlife-package-python.git", extras = ["dev"]}
codeforlife = {ref = "v0.18.12", git = "https://github.com/ocadotechnology/codeforlife-package-python.git", extras = ["dev"]}
# codeforlife = {file = "../codeforlife-package-python", editable = true, extras = ["dev"]}
# 🚫 Don't add [dev-packages] below that are inherited from the CFL package.

[requires]
python_version = "3.8"
python_version = "3.12"
854 changes: 412 additions & 442 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""

import os
from pathlib import Path

Expand Down
6 changes: 3 additions & 3 deletions src/api/serializers/auth_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def to_representation(self, instance):
self.view.action == "create"
and instance.type == AuthFactor.Type.OTP
):
representation[
"totp_provisioning_uri"
] = self.request.auth_user.totp_provisioning_uri
representation["totp_provisioning_uri"] = (
self.request.auth_user.totp_provisioning_uri
)

return representation
1 change: 1 addition & 0 deletions src/api/serializers/auth_factor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ def test_to_representation(self):
user=self.multi_auth_factor_teacher_user
),
},
non_model_fields={"totp_provisioning_uri"},
)
1 change: 1 addition & 0 deletions src/api/serializers/teacher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
© Ocado Group
Created on 29/01/2024 at 10:13:58(+00:00).
"""

import typing as t

from codeforlife.types import DataDict
Expand Down
11 changes: 6 additions & 5 deletions src/api/serializers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
© Ocado Group
Created on 18/01/2024 at 15:14:32(+00:00).
"""

import typing as t
from datetime import date, timedelta

Expand Down Expand Up @@ -480,11 +481,11 @@ def to_representation(self, instance):
instance.new_student
and instance.new_student.pending_class_request
):
representation[
"requesting_to_join_class"
] = self.ClassSerializer(
instance.new_student.pending_class_request
).data
representation["requesting_to_join_class"] = (
self.ClassSerializer(
instance.new_student.pending_class_request
).data
)
except Student.DoesNotExist:
pass

Expand Down
1 change: 1 addition & 0 deletions src/api/serializers/user_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
© Ocado Group
Created on 31/01/2024 at 16:07:32(+00:00).
"""

import typing as t
from datetime import date
from unittest.mock import Mock, patch
Expand Down
1 change: 1 addition & 0 deletions src/api/views/klass.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
© Ocado Group
Created on 23/01/2024 at 17:53:37(+00:00).
"""

from codeforlife.permissions import OR, AllowNone
from codeforlife.user.permissions import IsTeacher
from codeforlife.user.views import ClassViewSet as _ClassViewSet
Expand Down
1 change: 1 addition & 0 deletions src/api/views/klass_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
© Ocado Group
Created on 05/02/2024 at 16:13:46(+00:00).
"""

import typing as t
from datetime import timedelta

Expand Down
1 change: 1 addition & 0 deletions src/api/views/school_teacher_invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
© Ocado Group
Created on 09/02/2024 at 16:14:00(+00:00).
"""

import typing as t

from codeforlife.mail import send_mail
Expand Down
9 changes: 6 additions & 3 deletions src/api/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
© Ocado Group
Created on 23/01/2024 at 17:53:44(+00:00).
"""

import logging
from datetime import timedelta

Expand Down Expand Up @@ -186,9 +187,11 @@ def verify_email_address(self, request: Request, **url_params: str):
return Response(
status=status.HTTP_303_SEE_OTHER,
headers={
"Location": settings.PAGE_TEACHER_LOGIN
if user.teacher
else settings.PAGE_INDY_LOGIN
"Location": (
settings.PAGE_TEACHER_LOGIN
if user.teacher
else settings.PAGE_INDY_LOGIN
)
},
)

Expand Down
1 change: 1 addition & 0 deletions src/api/views/user_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
© Ocado Group
Created on 20/01/2024 at 10:58:52(+00:00).
"""

import typing as t
from datetime import timedelta
from unittest.mock import Mock, call, patch
Expand Down
1 change: 0 additions & 1 deletion src/sso/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Created on 01/12/2023 at 16:00:24(+00:00).
"""


from codeforlife.user.models import User
from django import forms
from django.contrib.auth import authenticate
Expand Down

0 comments on commit f4628a9

Please sign in to comment.