mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
Wrap 2 more BASE_URL usages with str()
In 59372aba33 a lazily evaluated BASE_URL tool was introduced.
I found 2 more cases in which BASE_URL was not "collapsed into a
string" magically by `__add__`, one of which actually causing
an `Object of type TenantBaseURL is not JSON serializable`
This commit is contained in:
@@ -203,7 +203,7 @@ def csrf_debug(request):
|
|||||||
# We do this here, and not in urls.py, because urls.py cannot be changed on-demand in tests
|
# We do this here, and not in urls.py, because urls.py cannot be changed on-demand in tests
|
||||||
raise Http404("This view is only available in DEBUG_CSRF mode.")
|
raise Http404("This view is only available in DEBUG_CSRF mode.")
|
||||||
|
|
||||||
context = {"relevant_settings": {"BASE_URL": get_settings().BASE_URL}}
|
context = {"relevant_settings": {"BASE_URL": str(get_settings().BASE_URL)}}
|
||||||
context["relevant_settings"].update({k: getattr(settings, k) for k in [
|
context["relevant_settings"].update({k: getattr(settings, k) for k in [
|
||||||
"ALLOWED_HOSTS",
|
"ALLOWED_HOSTS",
|
||||||
"SECURE_PROXY_SSL_HEADER",
|
"SECURE_PROXY_SSL_HEADER",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class StoreEnvelope:
|
|||||||
|
|
||||||
# arguably "debug", but if you turned StoreEnvelope on, you probably want to use its results "soon", and I'd
|
# arguably "debug", but if you turned StoreEnvelope on, you probably want to use its results "soon", and I'd
|
||||||
# rather not have another thing for people to configure.
|
# rather not have another thing for people to configure.
|
||||||
logger.info("envelope stored, available at %s%s", get_settings().BASE_URL, envelope.get_absolute_url())
|
logger.info("envelope stored, available at %s%s", str(get_settings().BASE_URL), envelope.get_absolute_url())
|
||||||
|
|
||||||
|
|
||||||
class DontStoreEnvelope:
|
class DontStoreEnvelope:
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ def _make_message_body():
|
|||||||
|
|
||||||
"settings": {
|
"settings": {
|
||||||
# Settings that tell us "who you are", and are relevant in the context of licensing.
|
# Settings that tell us "who you are", and are relevant in the context of licensing.
|
||||||
"BASE_URL": get_settings().BASE_URL,
|
"BASE_URL": str(get_settings().BASE_URL),
|
||||||
"SITE_TITLE": get_settings().SITE_TITLE,
|
"SITE_TITLE": get_settings().SITE_TITLE,
|
||||||
"DEFAULT_FROM_EMAIL": settings.DEFAULT_FROM_EMAIL,
|
"DEFAULT_FROM_EMAIL": settings.DEFAULT_FROM_EMAIL,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user