Skip to content

Commit

Permalink
Remove student confirmation token API
Browse files Browse the repository at this point in the history
  • Loading branch information
LudvigHz committed Jul 31, 2023
1 parent 5b08056 commit 35ca9df
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 169 deletions.
14 changes: 0 additions & 14 deletions lego/api/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@
)
from lego.apps.users.views.penalties import PenaltyViewSet
from lego.apps.users.views.registration import UserRegistrationRequestViewSet
from lego.apps.users.views.student_confirmation import (
StudentConfirmationPerformViewSet,
StudentConfirmationRequestViewSet,
)
from lego.apps.users.views.user_delete import UserDeleteViewSet
from lego.apps.users.views.users import UsersViewSet
from lego.utils.views import SiteMetaViewSet
Expand Down Expand Up @@ -203,15 +199,5 @@
UserRegistrationRequestViewSet,
basename="user-registration",
)
router.register(
r"users-student-confirmation-perform",
StudentConfirmationPerformViewSet,
basename="student-confirmation-perform",
)
router.register(
r"users-student-confirmation-request",
StudentConfirmationRequestViewSet,
basename="student-confirmation-request",
)
router.register(r"oidc", OIDCViewSet, basename="oidc")
router.register(r"webhooks-stripe", StripeWebhook, basename="webhooks-stripe")
5 changes: 2 additions & 3 deletions lego/apps/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ def profile_picture(self, value):
self.picture = value

def verify_student(self, feide_groups) -> bool:
# if self.is_verified_student():
# return True
if self.is_verified_student():
return True

if self.has_grade_group:
self.student_verification_status = True
Expand All @@ -466,7 +466,6 @@ def verify_student(self, feide_groups) -> bool:
return False

def is_verified_student(self):
return False
return self.student_verification_status

def get_short_name(self):
Expand Down
21 changes: 0 additions & 21 deletions lego/apps/users/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,27 +200,6 @@ def test_validate_registration_token(self):
token_email = Registrations.validate_registration_token(registration_token)
self.assertNotEqual(token_email, "wrongtest1@user.com")

def test_validate_student_confirmation_token(self):
student_confirmation_token = Registrations.generate_student_confirmation_token(
"teststudentusername", constants.DATA, True, False
)
token = Registrations.validate_student_confirmation_token(
student_confirmation_token
)
self.assertEqual(token["student_username"], "teststudentusername")
self.assertEqual(token["course"], constants.DATA)
self.assertEqual(token["member"], True)

student_confirmation_token = Registrations.generate_student_confirmation_token(
"teststudentusername", constants.DATA, True, False
)
token = Registrations.validate_student_confirmation_token(
student_confirmation_token
)
self.assertNotEqual(token["student_username"], "wrongtestusername")
self.assertNotEqual(token["course"], constants.KOMTEK)
self.assertNotEqual(token["member"], False)


class MembershipTestCase(BaseTestCase):
fixtures = ["test_abakus_groups.yaml", "test_users.yaml"]
Expand Down
130 changes: 0 additions & 130 deletions lego/apps/users/views/student_confirmation.py

This file was deleted.

1 change: 0 additions & 1 deletion lego/settings/lego.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
BEDKOM_BOOKING_PERIOD = ((2, 21), (3, 8))

REGISTRATION_CONFIRMATION_TIMEOUT = 60 * 60 * 24
STUDENT_CONFIRMATION_TIMEOUT = 60 * 60 * 24

PASSWORD_RESET_TIMEOUT = 60 * 60 * 24

Expand Down

0 comments on commit 35ca9df

Please sign in to comment.