def clean_audit_user(self): audit_user = self.cleaned_data['audit_user'][:-1] if self.cleaned_data['audit_user'][-1] == ';' \ else self.cleaned_data['audit_user'] if not check_value(audit_user, 'user')[0]: raise forms.ValidationError(u"审核人不合法") audit_user = audit_user.split(';') if len(audit_user) != Application.objects.get( cc_name=self.cleaned_data['business_name']).operator.filter(username__in=audit_user).count(): raise forms.ValidationError(u"审核人不合法") return self.cleaned_data['audit_user']
def clean_operator(self): operator = self.cleaned_data['operator'][:-1] if self.cleaned_data['operator'][-1] == ';'\ else self.cleaned_data['operator'] if not check_value(operator, 'user')[0]: raise forms.ValidationError(u"可操作者不合法") operator = operator.split(';') if len(operator) != Application.objects.get( cc_name=self.cleaned_data['business_name']).operator.filter(username__in=operator).count(): raise forms.ValidationError(u"可操作者不合法") return self.cleaned_data['operator']
step_num = 0 rol = 0 queue = deque([0]) for i in range(1, nrows): if table.row(i)[0].value: step = table.row(i)[0].value if step_num != 0: merge.append({ "row": queue.popleft(), "col": 0, "rowspan": step_num, "colspan": 1 }) queue.append(rol) step_num = 0 if not check_value(table.row(i)[4].value.replace(' ', ''), 'user')[0]: return render_json({ 'success': False, 'message': u'模板【责任人】部分用户不存在,请检查!' }) if not check_value( step + table.row(i)[2].value + table.row(i)[3].value + table.row(i)[4].value, "string")[0]: return render_json({ 'success': False, 'message': u'模板包含非法字符,请检查!' }) rol += 1 step_num += 1 parm_data.append({ 'step': step,
def clean_template_type(self): template_type = self.cleaned_data['template_type'] if not check_value(template_type, 'string')[0]: raise forms.ValidationError(u"模版类型名称不合法") return template_type
def clean_force_msg(self): force_msg = space_replace(self.cleaned_data['force_msg']) if not check_value(force_msg, 'string')[0]: raise forms.ValidationError(u"强制确认信息包含不合法字符") return force_msg
def clean_audit_reason(self): audit_reason = space_replace(self.cleaned_data['audit_reason']) if not check_value(audit_reason, 'string')[0]: raise forms.ValidationError(u"审核原因包含不合法字符") return audit_reason
def clean_version(self): version = self.cleaned_data['version'] if not check_value(version, 'string')[0]: raise forms.ValidationError(u"任务包含不合法字符") return version
def clean_comment(self): comment = space_replace(self.cleaned_data['comment']) if not check_value(comment, 'string')[0]: raise forms.ValidationError(u"备注包含不合法字符") return comment
def clean_operate_attention(self): operate_attention = space_replace(self.cleaned_data['operate_attention']) if not check_value(operate_attention, 'string')[0]: raise forms.ValidationError(u"操作事项包含不合法字符") return operate_attention