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)
def bugzilla(cls): if not hasattr(cls, "_bugzilla"): cls._bugzilla = Bugzilla.from_config() return cls._bugzilla
def bugzilla(self): # Returns the original bugzilla object return Bugzilla.from_config().bugzilla