b63886addf175201fe2d284c5267e232c670d3bf,app/grandchallenge/core/contextprocessors/contextprocessors.py,,comic_site,#Any#,11

Before Change


    
    
    try:
        resolution = resolve(request.path)
    except Http404 as e:
        // fail silently beacuse any exeception here will cause a 500 server
        // error on page. Let views show errors but not the context processor
        resolution = resolve("/")

    challenge_short_name = resolution.kwargs.get(
        "challenge_short_name", settings.MAIN_PROJECT_NAME
    )

    try:
        challenge = Challenge.objects.get(
            short_name__iexact=challenge_short_name
        )
        pages = challenge.page_set.all()
    except Challenge.DoesNotExist:
        // Don"t crash the system here, if a challenge cannot be found it will
        // crash in a more appropriate location

After Change


        user = get_anonymous_user()

    if challenge is None:
        permissions = pages = []
        is_participant = False
    else:
        permissions = get_perms(user, challenge)
        pages = challenge.page_set.all()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: comic/grand-challenge.org
Commit Name: b63886addf175201fe2d284c5267e232c670d3bf
Time: 2018-12-03
Author: jamesmeakin@gmail.com
File Name: app/grandchallenge/core/contextprocessors/contextprocessors.py
Class Name:
Method Name: comic_site


Project Name: pantsbuild/pants
Commit Name: 0a6edd21b9ab29a1f733b90ff15092e7a03f665d
Time: 2014-01-15
Author: jsirois@twitter.com
File Name: src/python/twitter/pants/targets/python_target.py
Class Name: PythonTarget
Method Name: __init__


Project Name: tgsmith61591/pmdarima
Commit Name: 942f284052b22214d830c1bc2c8de03bffaa8d07
Time: 2020-02-18
Author: aaronreidsmith@gmail.com
File Name: build_tools/azure/render_meta.py
Class Name:
Method Name:


Project Name: matthewwithanm/django-imagekit
Commit Name: b0b466618f669f87ecfe66b9dd655415ba88ed83
Time: 2012-10-17
Author: m@tthewwithanm.com
File Name: imagekit/templatetags/imagekit_tags.py
Class Name: SpecNode
Method Name: render