change(fastapi): decouple update logic from account edit

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-17 05:40:11 -08:00
parent 94972841d6
commit 303585cdbf
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 128 additions and 74 deletions

View file

@ -7,6 +7,7 @@ import secrets
import string
from datetime import datetime
from distutils.util import strtobool as _strtobool
from typing import Any, Callable, Dict, Iterable, Tuple
from urllib.parse import urlencode, urlparse
from zoneinfo import ZoneInfo
@ -170,3 +171,9 @@ def sanitize_params(offset: str, per_page: str) -> Tuple[int, int]:
per_page = defaults.PP
return (offset, per_page)
def strtobool(value: str) -> bool:
if isinstance(value, str):
return _strtobool(value)
return value