mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: Hide Email Address checkbox markup
also: - support empty strings in util.strtobool Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
6986d1bb1e
commit
ac68f74c69
2 changed files with 8 additions and 4 deletions
|
@ -7,7 +7,7 @@ import string
|
|||
from datetime import datetime
|
||||
from distutils.util import strtobool as _strtobool
|
||||
from http import HTTPStatus
|
||||
from typing import Callable, Iterable, Tuple
|
||||
from typing import Callable, Iterable, Tuple, Union
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import fastapi
|
||||
|
@ -133,9 +133,9 @@ def sanitize_params(offset: str, per_page: str) -> Tuple[int, int]:
|
|||
return (offset, per_page)
|
||||
|
||||
|
||||
def strtobool(value: str) -> bool:
|
||||
def strtobool(value: Union[str, bool]) -> bool:
|
||||
if isinstance(value, str):
|
||||
return _strtobool(value)
|
||||
return _strtobool(value or "False")
|
||||
return value
|
||||
|
||||
|
||||
|
|
|
@ -105,7 +105,11 @@
|
|||
{% trans %}Hide Email Address{% endtrans %}:
|
||||
</label>
|
||||
|
||||
<input id="id_hide" type="checkbox" name="H" value="{{ H }}">
|
||||
<input id="id_hide" type="checkbox" name="H"
|
||||
{% if hide_email %}
|
||||
checked="checked"
|
||||
{% endif %}
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
<em>{{ "If you do not hide your email address, it is "
|
||||
|
|
Loading…
Add table
Reference in a new issue