Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FUSS
octonet
Commits
05272ce5
Commit
05272ce5
authored
Mar 19, 2020
by
Mark Caglienzi
Browse files
Fix last_password_change_days calculation. refs #9972
parent
4fd5d136
Changes
1
Hide whitespace changes
Inline
Side-by-side
users/views.py
View file @
05272ce5
...
...
@@ -141,7 +141,7 @@ class UserMixin(OctonetMixin):
last_password_change
=
epoch
+
datetime
.
timedelta
(
days
=
shadowLastChange
)
if
shadowLastChange
:
self
.
user
[
'last_password_change'
]
=
last_password_change
.
strftime
(
"%Y-%m-%d"
)
self
.
user
[
'last_password_change_days'
]
=
_
(
"{} day(s) ago"
).
format
((
last_password_change
-
today
).
days
)
self
.
user
[
'last_password_change_days'
]
=
_
(
"{} day(s) ago"
).
format
((
today
-
last_password_change
).
days
)
else
:
self
.
user
[
'last_password_change'
]
=
"-"
self
.
user
[
'last_password_change_days'
]
=
_
(
"0 day(s) ago"
)
...
...
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