mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fixes for compact blocking functionality
This commit is contained in:
parent
5a3f6eee5a
commit
f948cdeec8
|
@ -579,7 +579,7 @@ def block_expiry(change: dict) -> str:
|
||||||
timedelta_for_expiry.seconds % 31557600 // 86400, \
|
timedelta_for_expiry.seconds % 31557600 // 86400, \
|
||||||
timedelta_for_expiry.seconds % 86400 // 3600, timedelta_for_expiry.seconds % 3600 // 60
|
timedelta_for_expiry.seconds % 86400 // 3600, timedelta_for_expiry.seconds % 3600 // 60
|
||||||
if not any([years, days, hours, minutes]):
|
if not any([years, days, hours, minutes]):
|
||||||
return _("less than a minute")
|
return _("for less than a minute")
|
||||||
time_names = (
|
time_names = (
|
||||||
ngettext("year", "years", years), ngettext("day", "days", days), ngettext("hour", "hours", hours),
|
ngettext("year", "years", years), ngettext("day", "days", days), ngettext("hour", "hours", hours),
|
||||||
ngettext("minute", "minutes", minutes))
|
ngettext("minute", "minutes", minutes))
|
||||||
|
@ -587,7 +587,7 @@ def block_expiry(change: dict) -> str:
|
||||||
for num, timev in enumerate([years, days, hours, minutes]):
|
for num, timev in enumerate([years, days, hours, minutes]):
|
||||||
if timev:
|
if timev:
|
||||||
final_time.append(
|
final_time.append(
|
||||||
_("{time_unit} {time_number}").format(time_unit=time_names[num], time_number=timev))
|
_("for {time_number} {time_unit}").format(time_unit=time_names[num], time_number=timev))
|
||||||
return ", ".join(final_time)
|
return ", ".join(final_time)
|
||||||
else:
|
else:
|
||||||
return change["logparams"]["duration"] # Temporary? Should be rare? We will see in testing
|
return change["logparams"]["duration"] # Temporary? Should be rare? We will see in testing
|
||||||
|
|
Loading…
Reference in a new issue