Custom form errors If you want to validate something in the view, and return with a custom error message in the same form, you can use the “Form.add_error(fieldname, errorstring)” method. And then, of course, return to the previous template. class MyView(View): def get(self, request): data = form.cleaned_data if len(res) > 0: form.add_error( ‘login’, “Diese Personalnummer […]
Categories