def get_bugmail_messages(): """ Check bugmail for updated bugs, and get their data from Bugzilla. """ msgs = get_bugmails() bugids = store_messages(msgs) if bugids: update_bugs.delay(bugids)
def post(self, request, *args, **kwargs): key = request.POST.get('api-key') if not (self.api_key and key and key == self.api_key): return HttpResponseForbidden() email = request.POST.get('email') if email: msgs = get_bugmail_str(email) bugids = store_messages(msgs) if bugids: log.debug('Got bugmail for bug {0} via view'.format(bugids[0])) update_bugs.delay(bugids) return HttpResponse() else: return HttpResponseBadRequest()
def handle_noargs(self, **options): msgs = get_bugmail_stdin() bugids = store_messages(msgs) if bugids: update_bugs.delay(bugids)