def clean_comment(self): # Comment field needed for duplicate, flag, moreinfo, and other reject # reason. action = self.cleaned_data.get('action') reject_reason = self.cleaned_data.get('reject_reason') comment = self.cleaned_data.get('comment') if (not comment and (action == amo.ACTION_FLAG or action == amo.ACTION_MOREINFO or (action == amo.ACTION_REJECT and reject_reason == 0))): raise_required() return comment
def clean_comment(self): # Comment field needed for duplicate, flag, moreinfo, and other reject # reason. action = self.cleaned_data.get('action') reject_reason = self.cleaned_data.get('reject_reason') comment = self.cleaned_data.get('comment') if (not comment and (action == rvw.ACTION_FLAG or action == rvw.ACTION_MOREINFO or (action == rvw.ACTION_REJECT and reject_reason == 0))): raise_required() return comment
def clean_body(self): body = self.cleaned_data.get('body', '') # Whitespace is not a review! if not body.strip(): raise_required() return body
def clean_reject_reason(self): reject_reason = self.cleaned_data.get('reject_reason', None) if (self.cleaned_data.get('action') == rvw.ACTION_REJECT and reject_reason is None): raise_required() return reject_reason
def clean_reject_reason(self): reject_reason = self.cleaned_data.get('reject_reason', None) if (self.cleaned_data.get('action') == amo.ACTION_REJECT and reject_reason is None): raise_required() return reject_reason