Skip to content

Commit

Permalink
Fix waiver date timezone
Browse files Browse the repository at this point in the history
We're just not going to store dates in UTC format. Nothing else in the app does!
  • Loading branch information
kitsuta committed Apr 5, 2024
1 parent a0a4958 commit a7a2b49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 4 additions & 5 deletions magstock/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ class Consents:
waiver_signature = StringField(
'Electronic Signature',
validators=[validators.DataRequired("You must sign your full legal name to consent to the waiver.")])
waiver_date_display = DateField('Date of Signature', render_kw={'disabled': True})
waiver_date = HiddenField('Date of Signature (UTC)',
validators=[validators.DataRequired("No date of signature. "
"Please refresh the page or contact us.")])
waiver_date = DateField('Date of Signature',
validators=[validators.DataRequired("No date of signature. "
"Please refresh the page or contact us.")],
render_kw={'readonly': True})
waiver_consent = BooleanField(
Markup('<strong>Yes</strong>, I understand that checking this box constitutes a legal signature '
'confirming that I acknowledge and agree to the above waiver.'),
Expand Down Expand Up @@ -113,7 +113,6 @@ class PreregOtherInfo:
legal_name = HiddenField('Legal Name')
acknowledged_checkin_policy = Consents.acknowledged_checkin_policy
waiver_signature = Consents.waiver_signature
waiver_date_display = Consents.waiver_date_display
waiver_date = Consents.waiver_date
waiver_consent = Consents.waiver_consent

Expand Down
3 changes: 1 addition & 2 deletions magstock/templates/forms/attendee/consents.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
<div class="row g-sm-3">
<div class="col-12 col-sm-6">{{ form_macros.form_input(consents.waiver_signature) }}</div>
<div class="col-12 col-sm-6">
{{ form_macros.form_input(consents.waiver_date_display, value=now()|datetime_local("%Y-%m-%d")) }}
{{ form_macros.form_input(consents.waiver_date, value=now()|datetime("%Y-%m-%d")) }}
{{ form_macros.form_input(consents.waiver_date, value=now()|datetime_local("%Y-%m-%d")) }}
</div>
</div>

Expand Down
3 changes: 1 addition & 2 deletions magstock/templates/forms/attendee/prereg_other_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
<div class="row g-sm-3">
<div class="col-12 col-sm-6">{{ form_macros.form_input(other_info.waiver_signature) }}</div>
<div class="col-12 col-sm-6">
{{ form_macros.form_input(other_info.waiver_date_display, value=now()|datetime_local("%Y-%m-%d")) }}
{{ form_macros.form_input(other_info.waiver_date, value=now()|datetime("%Y-%m-%d")) }}
{{ form_macros.form_input(other_info.waiver_date, value=now()|datetime_local("%Y-%m-%d")) }}
</div>
</div>

Expand Down

0 comments on commit a7a2b49

Please sign in to comment.