plugin ad-hoc registration: Implement plugin to handle registration links:
registration links are used in web frontend to allow registration with secret links when it's normally closed.
This commit is contained in:
parent
f1cc34cc53
commit
ff5c2e0ea5
1 changed files with 350 additions and 4 deletions
|
|
@ -86,17 +86,17 @@ def date_parse(value, default_tz=TZ_UTC):
|
|||
raise e
|
||||
return calendar.timegm(dt.utctimetuple())
|
||||
|
||||
def date_parse_ext(value, default_tz=TZ_UTC):
|
||||
def date_parse_ext(value: str, default_tz: datetime.tzinfo=TZ_UTC) -> float:
|
||||
"""Extended date parse which accept relative date
|
||||
|
||||
@param value(unicode): date to parse, in any format supported by parser
|
||||
@param value: date to parse, in any format supported by parser
|
||||
and with the hability to specify X days/weeks/months/years in the past or future.
|
||||
Relative date are specified either with something like `[main_date] +1 week`
|
||||
or with something like `3 days ago`, and it is case insensitive. [main_date] is
|
||||
a date parsable by parser, or empty to specify current date/time.
|
||||
"now" can also be used to specify current date/time.
|
||||
@param default_tz(datetime.tzinfo): same as for date_parse
|
||||
@return (int): timestamp
|
||||
@param default_tz: same as for date_parse
|
||||
@return: timestamp
|
||||
"""
|
||||
m = RELATIVE_RE.match(value)
|
||||
if m is None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue