Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
Diskominfo-D'Blood
Mantan Aab-D Blood
Commits
37f638be
Commit
37f638be
authored
Jun 24, 2020
by
Nabila Febri Viola
Browse files
[REFACTOR] Fix age property in profile model
parent
7c284880
Pipeline
#50090
passed with stages
in 1 minute and 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/main/models.py
View file @
37f638be
...
...
@@ -93,6 +93,8 @@ class Profile(models.Model):
@
property
def
age
(
self
):
if
self
.
birthdate
is
None
:
return
0
born
=
self
.
birthdate
today
=
date
.
today
()
return
today
.
year
-
born
.
year
-
((
today
.
month
,
today
.
day
)
<
(
born
.
month
,
born
.
day
))
...
...
Write
Preview
Supports
Markdown
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