Commit 62f32761 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[accounts] added last_validation date information for revalidation procedure

parent 4be47912
......@@ -419,6 +419,8 @@ class SuperviseeReValidationView(BaseUpdateSupervisionTrackFromSuperviseeView):
def put(self, request):
supervisee = request.user
now = datetime.datetime.now()
if supervisee.profile.supervision_key is not None:
#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'))
......@@ -434,6 +436,7 @@ class SuperviseeReValidationView(BaseUpdateSupervisionTrackFromSuperviseeView):
expiration_date_delta = datetime.timedelta(days=settings.ACCOUNT_EXPIRATION_DAYS)
new_expiration_date = supervisiontrack.expiration_date + expiration_date_delta
supervisiontrack.expiration_date = new_expiration_date
supervisiontrack.last_validation_date = now
else:
#Change status
expiration_date_delta = datetime.timedelta(days=settings.ACCOUNT_BLOCKAGE_AFTER_FIRST_REJECTION_DAYS)
......
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