Skip to content
Snippets Groups Projects
Commit 62f32761 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[accounts] added last_validation date information for revalidation procedure

parent 4be47912
No related branches found
No related tags found
1 merge request!224Security accounts
...@@ -419,6 +419,8 @@ class SuperviseeReValidationView(BaseUpdateSupervisionTrackFromSuperviseeView): ...@@ -419,6 +419,8 @@ class SuperviseeReValidationView(BaseUpdateSupervisionTrackFromSuperviseeView):
def put(self, request): def put(self, request):
supervisee = request.user supervisee = request.user
now = datetime.datetime.now()
if supervisee.profile.supervision_key is not None: if supervisee.profile.supervision_key is not None:
#There's a key check if there's a valid track #There's a key check if there's a valid track
supervisiontrack = SupervisionTrack.objects.get(supervisee=supervisee, supervisee__profile__supervision_key=models.F('supervision_key')) supervisiontrack = SupervisionTrack.objects.get(supervisee=supervisee, supervisee__profile__supervision_key=models.F('supervision_key'))
...@@ -434,6 +436,7 @@ class SuperviseeReValidationView(BaseUpdateSupervisionTrackFromSuperviseeView): ...@@ -434,6 +436,7 @@ class SuperviseeReValidationView(BaseUpdateSupervisionTrackFromSuperviseeView):
expiration_date_delta = datetime.timedelta(days=settings.ACCOUNT_EXPIRATION_DAYS) expiration_date_delta = datetime.timedelta(days=settings.ACCOUNT_EXPIRATION_DAYS)
new_expiration_date = supervisiontrack.expiration_date + expiration_date_delta new_expiration_date = supervisiontrack.expiration_date + expiration_date_delta
supervisiontrack.expiration_date = new_expiration_date supervisiontrack.expiration_date = new_expiration_date
supervisiontrack.last_validation_date = now
else: else:
#Change status #Change status
expiration_date_delta = datetime.timedelta(days=settings.ACCOUNT_BLOCKAGE_AFTER_FIRST_REJECTION_DAYS) expiration_date_delta = datetime.timedelta(days=settings.ACCOUNT_BLOCKAGE_AFTER_FIRST_REJECTION_DAYS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment