Skip to content

Commit

Permalink
Allow ages over 100 (#1448)
Browse files Browse the repository at this point in the history
Oldest recorded human was 122 years 164 days but we're pretty sure she wasn't a Weasyl user. Either way, it might happen and we shouldn't be ageist.

(no, this comment isn't entirely serious but we might as well fix this)

Fixes #1447

Reviewed-by: Charmander <~@charmander.me>
  • Loading branch information
philpem authored Nov 1, 2024
1 parent 67f148e commit 462fcaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion weasyl/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def edit_userinfo(userid, form):
birthdate_month = int(form['birthdate-month'])
birthdate_year = int(form['birthdate-year'])

if not (1 <= birthdate_month <= 12) or not (-100 <= birthdate_year - arrow.utcnow().year <= 0):
if not (1 <= birthdate_month <= 12) or not (-125 <= birthdate_year - arrow.utcnow().year <= 0):
raise WeasylError("birthdayInvalid")

birthdate_update = _BIRTHDATE_UPDATE_BASE
Expand Down
2 changes: 1 addition & 1 deletion weasyl/templates/control/edit_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h3>Profile Settings</h3>
<label class="form-date-year">
<span class="sublabel">Year</span>
$ current_year = arrow.utcnow().year
<input class="input" name="birthdate-year" type="number" min="${current_year - 100}" max="${current_year - 12}" value="${'' if birthdate is None else birthdate.year}" autocomplete="bday-year">
<input class="input" name="birthdate-year" type="number" min="${current_year - 125}" max="${current_year - 12}" value="${'' if birthdate is None else birthdate.year}" autocomplete="bday-year">
</label>
</div>
</fieldset>
Expand Down

0 comments on commit 462fcaa

Please sign in to comment.