Saleor: Wrong type for build_absolute_uri function

Created on 18 Sep 2018  路  5Comments  路  Source: mirumee/saleor

The # type of build_absolute_uri function is outdated

def build_absolute_uri(location):
    # type: (str, bool, saleor.site.models.SiteSettings) -> str  # - problem there
    host = Site.objects.get_current().domain
    protocol = 'https' if settings.ENABLE_SSL else 'http'
    current_uri = '%s://%s' % (protocol, host)
    location = urljoin(current_uri, location)
    return iri_to_uri(location)
help wanted

All 5 comments

@mmmcorpsvit or @Pacu2 Could you edit the description to make it clear what needs to be fixed?

@maarcingebala done

comment there are doc-string, and have bad format

please see:
https://docs.python.org/3/library/typing.html
or
https://www.python.org/dev/peps/pep-0257/

i think must be

 # type: (str) -> str

Closed via #2929

Was this page helpful?
0 / 5 - 0 ratings