mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
yesno filter: just don't return None ever
I had someone run into this on hosted Bugsink; couldn't reproduce it.
Thought I fixed it in e8fb9556f7 (specific to the Chinese translation)
but appararently there's other ways to reach this point.
No matter, just create a version of the yesno filter that's not sensitive
to any future mistranslation.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import stat
|
||||
import logging
|
||||
from django.template.defaultfilters import yesno as broken_yesno
|
||||
|
||||
from .future_python import makedirs
|
||||
|
||||
@@ -100,3 +101,13 @@ def b108_makedirs(path):
|
||||
break
|
||||
|
||||
current = parent
|
||||
|
||||
|
||||
def yesno(value, arg=None):
|
||||
"""
|
||||
See https://code.djangoproject.com/ticket/36579
|
||||
"""
|
||||
result = broken_yesno(value, arg)
|
||||
if result is None:
|
||||
return "Maybe"
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user