Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.web
Commits
62f32761
Commit
62f32761
authored
Jul 21, 2017
by
Flavio TARSETTI
Browse files
[accounts] added last_validation date information for revalidation procedure
parent
4be47912
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/web/accounts/api.py
View file @
62f32761
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment