Esempio n. 1
0
def check_query(request):
    if not request.user.is_authenticated():
        return go_home(request)
    if request.method != 'POST':
        return HttpResponseForbidden('Only POST allowed')
    bz = Bugzilla.from_config().bugzilla
    try:
        parsed = bz.url_to_query(request.POST['url'])
        if not parsed:
            parsed = None
    except:
        parsed = None
    if 'cmdtype' in parsed:
        # It is a command and that is not supported within .query()
        parsed = None
    return json_response(parsed)
Esempio n. 2
0
def check_query(request):
    if not request.user.is_authenticated():
        return go_home(request)
    if request.method != 'POST':
        return HttpResponseForbidden('Only POST allowed')
    bz = Bugzilla.from_config().bugzilla
    try:
        parsed = bz.url_to_query(request.POST['url'])
        if not parsed:
            parsed = None
    except:
        parsed = None
    if 'cmdtype' in parsed:
        # It is a command and that is not supported within .query()
        parsed = None
    return json_response(parsed)
Esempio n. 3
0
 def bugzilla(cls):
     if not hasattr(cls, "_bugzilla"):
         cls._bugzilla = Bugzilla.from_config()
     return cls._bugzilla
Esempio n. 4
0
 def bugzilla(cls):
     if not hasattr(cls, "_bugzilla"):
         cls._bugzilla = Bugzilla.from_config()
     return cls._bugzilla
Esempio n. 5
0
 def bugzilla(self):
     # Returns the original bugzilla object
     return Bugzilla.from_config().bugzilla