e357e1dbcdf36eb12be0bc5043e0a098f94a833a,django/comicsite/templatetags/comic_templatetags.py,comic_URLNode,render,#comic_URLNode#Any#,250

Before Change


            // path to this comicsite?

            try:
                project = re.findall("^\/site\/([^\/]+)\/.*$", url)[0]

            except IndexError:
                // this url cannot use the domain name shortcut, so it is
                // probably meant as a link the main comicframework site.

After Change


            // Interpret subdomain as a comicsite. What would normally be the
            // path to this comicsite?

            args = [arg.resolve(context) for arg in self.args]
            project = args[0]

            if project == settings.MAIN_PROJECT_NAME:
                // this url cannot use the domain name shortcut, so it is
                // probably meant as a link the main comicframework site.
                // in that case hardcode the domain to make sure the sub-
                // domain is gone after following this link
                return settings.MAIN_HOST_NAME + url

            path_to_site = reverse_djangocore("comicsite.views.site", args=[project]).lower()

            if url.startswith(path_to_site):
                return url.replace(path_to_site, "/")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: comic/grand-challenge.org
Commit Name: e357e1dbcdf36eb12be0bc5043e0a098f94a833a
Time: 2017-05-09
Author: jamesmeakin@gmail.com
File Name: django/comicsite/templatetags/comic_templatetags.py
Class Name: comic_URLNode
Method Name: render


Project Name: osmr/imgclsmob
Commit Name: d9f6e28568406c162b79f582ae037a89a3118d26
Time: 2021-02-16
Author: osemery@gmail.com
File Name: prep_model.py
Class Name:
Method Name: post_process


Project Name: acl-org/acl-anthology
Commit Name: 8da2cf9d1c7af308ffcf906fe828b0dc23b52056
Time: 2020-05-22
Author: post@cs.jhu.edu
File Name: bin/ingest.py
Class Name:
Method Name: main