Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: used the shared ssn function for birthday #2941

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/benefit/applications/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import date, datetime
from datetime import date

from dateutil.relativedelta import relativedelta
from django.conf import settings
Expand Down Expand Up @@ -34,6 +34,7 @@
from common.localized_iban_field import LocalizedIBANField
from common.utils import DurationMixin
from companies.models import Company
from shared.common.utils import social_security_number_birthdate
from shared.models.abstract_models import TimeStampedModel, UUIDModel
from users.models import User

Expand Down Expand Up @@ -863,7 +864,7 @@ def birthday(self):
return None
# invalid social security number results in ValueError.
# input validation should ensure it's always valid.
return datetime.strptime(self.social_security_number[:6], "%d%m%y").date()
return social_security_number_birthdate(self.social_security_number)

def __str__(self):
return "{} {} ({})".format(self.first_name, self.last_name, self.email)
Expand Down
Loading