Skip to content

spp_registry: registration_date default and _birthdate_onchange still use the server date, refusing valid births east of UTC #520

Description

@LunarCapsule127

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions