url()
does not return a ParseResult
when using empty string default value
#404
Labels
bug
Something isn't working
https://django-environ.readthedocs.io/en/latest/api.html#environ.Env.url indicates that
url()
returns aurllib.parse.ParseResult
, but sometimes it can return astr
:Contrast with the behavior for an empty (but set) environment variable:
Usually, I want to call
geturl()
immediately on the result ofurl()
, and it would be convenient if this worked consistently instead of sometimes raisingAttributeError: 'str' object has no attribute 'geturl'
.url()
does useparse_default=True
:django-environ/environ/environ.py
Lines 292 to 301 in 7720a49
However, when
default
coerces toFalse
, it is not parsed:django-environ/environ/environ.py
Lines 429 to 430 in 7720a49
I see that the
and value
logic was added as a fix for #44, but I wonder if we could check forand value is not None
instead. I'll try this and see if all tests continue to pass.The text was updated successfully, but these errors were encountered: