@non_atomic_requests
def reporter(request):
    query = request.GET.get('guid')
    if query:
        qs = None
        if query.isdigit():
            qs = Addon.with_unlisted.filter(id=query)
        if not qs:
            qs = Addon.with_unlisted.filter(slug=query)
        if not qs:
            qs = Addon.with_unlisted.filter(guid=query)
        if not qs and len(query) > 4:
            qs = CompatReport.objects.filter(guid__startswith=query)
        if qs:
            guid = qs[0].guid
            addon = Addon.with_unlisted.get(guid=guid)
            if addon.is_listed or owner_or_unlisted_reviewer(request, addon):
                return redirect('compat.reporter_detail', guid)
    addons = (Addon.with_unlisted.filter(authors=request.user)
              if request.user.is_authenticated() else [])
    return render(request, 'compat/reporter.html',
                  dict(query=query, addons=addons))
dataset/ETHPy150Open mozilla/addons-server/src/olympia/compat/views.py/reporter/original