Follow-up to OpenSPP/OpenSPP2#397, where _check_birthdate_not_future moved to fields.Date.context_today so a registrar east of UTC isn't refused a birth recorded earlier that local day. Two sibling checks still compare against the server's date, so the same registrar still hits the problem on other paths:
spp_registry/models/registrant.py:47 — registration_date defaults to fields.Date.today(), and _check_registration_date rejects registration_date < birthdate (registrant.py:134). Creating a registrant with today's local birthdate east of UTC therefore fails: the defaulted registration date is the server's yesterday. The same method's upper bound at registrant.py:131 uses date.today() directly.
spp_registry/models/individual.py:97 — _birthdate_onchange silently resets that same valid date in the form.
Aligning all three on fields.Date.context_today would finish the job started in OpenSPP/OpenSPP2#397.
Raised by @gonzalesedwin1123 in review on OpenSPP/OpenSPP2#397 as a non-blocking follow-up.
Follow-up to OpenSPP/OpenSPP2#397, where _check_birthdate_not_future moved to fields.Date.context_today so a registrar east of UTC isn't refused a birth recorded earlier that local day. Two sibling checks still compare against the server's date, so the same registrar still hits the problem on other paths:
spp_registry/models/registrant.py:47 — registration_date defaults to fields.Date.today(), and _check_registration_date rejects registration_date < birthdate (registrant.py:134). Creating a registrant with today's local birthdate east of UTC therefore fails: the defaulted registration date is the server's yesterday. The same method's upper bound at registrant.py:131 uses date.today() directly.
spp_registry/models/individual.py:97 — _birthdate_onchange silently resets that same valid date in the form.
Aligning all three on fields.Date.context_today would finish the job started in OpenSPP/OpenSPP2#397.
Raised by @gonzalesedwin1123 in review on OpenSPP/OpenSPP2#397 as a non-blocking follow-up.