Processes invalid forms.

        Called if one of the forms is invalid. Re-renders the context data with the data-filled
        forms and errors.
483082
def form_invalid(self, post_form, attachment_formset, **kwargs):
        
        if (
            attachment_formset and
            not attachment_formset.is_valid() and
            len(attachment_formset.errors)
        ):
            messages.error(self.request, self.attachment_formset_general_error_message)

        return self.render_to_response(
            self.get_context_data(
                post_form=post_form, attachment_formset=attachment_formset, **kwargs
            ),
        )
460538
def handler(event, context):
    
    records = deserialize_records(event['Records'])

    # Split records into two groups, update and delete.
    # We don't want to query for deleted records.
    update_records, delete_records = group_records_by_type(records)
    capture_delete_records(delete_records)

    # filter out error events
    update_records = [e for e in update_records if not e['detail'].get('errorCode')]

    # group records by account for more efficient processing
    log.debug('Update Records: {records}'.format(records=records))

    capture_update_records(update_records)
1236272
public function process()
    {
        $form = $this->getForm();
        if ($form !== null && $form->isSubmitted()) {
            $data = $form->getFormData();
            if (isset($data[$this->id])) {
                $this->selected_value = $data[$this->id];

                $view = $this->getFirstAncestor('SwatView');
                if ($view !== null) {
                    $selection = new SwatViewSelection(array(
                        $this->selected_value
                    ));

                    $view->setSelection($selection, $this);
                }
            }
        }
    }
565984
function() {
			/// <summary>
			/// Validates the form, returns true if it is valid, false otherwise.
			/// This behaves as a normal submit event, but returns the result.
			/// </summary>
			/// <returns type="Boolean" />

			this.checkForm();
			$.extend(this.submitted, this.errorMap);
			this.invalid = $.extend({}, this.errorMap);
			if (!this.valid())
				$(this.currentForm).triggerHandler("invalid-form", [this]);
			this.showErrors();
			return this.valid();
		}
1338441
public function process()
	{
		$context = $this->getContext();
		$view = $this->getView();

		try
		{
			parent::process();
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->filterErrorList = $view->get( 'filterErrorList', [] ) + $error;
		}
		catch( \Aimeos\Controller\Frontend\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->filterErrorList = $view->get( 'filterErrorList', [] ) + $error;
		}
		catch( \Aimeos\Client\Html\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
			$view->filterErrorList = $view->get( 'filterErrorList', [] ) + $error;
		}
		catch( \Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
			$view->filterErrorList = $view->get( 'filterErrorList', [] ) + $error;
			$this->logException( $e );
		}
	}
962068
def clean(self, value):
        
        if not value:
            raise ValidationError(
                'Error found in Form Field: Nothing to validate')

        data = dict((bf.name, value[i]) for i, bf in enumerate(self.form))
        self.form = form = self.form.__class__(data)
        if not form.is_valid():
            error_dict = list(form.errors.items())
            raise ValidationError([
                ValidationError(mark_safe('{} {}'.format(
                    k.title(), v)), code=k) for k, v in error_dict])

        # This call will ensure compress is called as expected.
        return super(FormField, self).clean(value)
42963
protected function processValues()
    {
        $form = $this->getForm();
        $data = &$form->getFormData();

        if (isset($data[$this->id])) {
            if (is_array($data[$this->id])) {
                $this->values = $data[$this->id];
            } elseif ($data[$this->id] != '') {
                $this->values = array($data[$this->id]);
            } else {
                $this->values = array();
            }
        } else {
            $this->values = array();
        }
    }
425471
def form_valid(self, form):
        # lb = SalesLines.objects.filter(pk=self.__line_pk).first()

        # product_old = lb.product_final
        product_pk = self.request.POST.get("product_final", None)
        quantity = self.request.POST.get("quantity", None)
        product_final = ProductFinal.objects.filter(pk=product_pk).first()
        
        if product_final and quantity:
            reason = form.data['reason']
            if reason:
                reason_obj = ReasonModification.objects.filter(pk=reason).first()
                if reason_obj:
                    try:
                        with transaction.atomic():
                            result = super(LinesUpdateModalBasket, self).form_valid(form)

                            reason_basket = ReasonModificationLineBasket()
                            reason_basket.basket = self.object.basket
                            reason_basket.reason = reason_obj
                            reason_basket.line = self.object
                            reason_basket.user = get_current_user()
                            reason_basket.quantity = self.object.quantity
                            reason_basket.save()
                            return result
                    except ValidationError as e:
                        errors = form._errors.setdefault("product_final", ErrorList())
                        errors.append(e)
                        return super(LinesUpdateModalBasket, self).form_invalid(form)
                else:
                    errors = form._errors.setdefault("reason", ErrorList())
                    errors.append(_("Reason of modification invalid"))
                    return super(LinesUpdatelOrder, self).form_invalid(form)
            else:
                errors = form._errors.setdefault("reason", ErrorList())
                errors.append(_("Reason of modification invalid"))
                return super(LinesUpdatelOrder, self).form_invalid(form)

            """
            if is_pack:
                options = product.productfinals_option.filter(active=True)
                options_pack = []
                for option in options:
                    field = 'packs[{}]'.format(option.pk)
                    opt = self.request.POST.get(field, None)
                    if opt:
                        opt_product = ProductFinal.objects.filter(pk=opt).first()
                        if opt_product:
                            options_pack.append({
                                'product_option': option,
                                'product_final': opt_product,
                                'quantity': quantity
                            })
                        else:
                            errors = form._errors.setdefault(field, ErrorList())
                            errors.append(_("Product Option invalid"))
                            return super(LinesUpdateModalBasket, self).form_invalid(form)
                    else:
                        errors = form._errors.setdefault(field, ErrorList())
                        errors.append(_("Option invalid"))
                        return super(LinesUpdateModalBasket, self).form_invalid(form)
            """
        else:
            errors = form._errors.setdefault("product_final", ErrorList())
            errors.append((_("Product invalid"), quantity, product_final))
            return super(LinesUpdateModalBasket, self).form_invalid(form)

        """
        ret = super(LinesUpdateModalBasket, self).form_valid(form)
        if product_old != self.object.product:
            self.object.remove_options()
        if is_pack:
            self.object.set_options(options_pack)
        return ret
        """
725616
def form_valid(self, form):
        '''  '''
        form.cleaned_data.pop('template', None)
        self.request.session[EMAIL_VALIDATION_STR] = {'form_data': form.cleaned_data}
        return HttpResponseRedirect(reverse('emailConfirmation'))
857042
def process_form(self, instance, field, form, empty_marker=None,
                     emptyReturnsMarker=False, validating=True):
        
        service_uids = form.get("uids", [])
        return service_uids, {}
1146373
private void executeValidate(FacesContext context) {
        try {
            validate(context);
        } catch (RuntimeException e) {
            context.renderResponse();
            throw e;
        }

        if (!isValid()) {
            context.validationFailed();
            context.renderResponse();
        }
    }
1251134
def full_clean(self):
        
        super(SuperFormMixin, self).full_clean()
        for field_name, composite in self.forms.items():
            composite.full_clean()
            if not composite.is_valid() and composite._errors:
                self._errors[field_name] = ErrorDict(composite._errors)
        for field_name, composite in self.formsets.items():
            composite.full_clean()
            if not composite.is_valid() and composite._errors:
                self._errors[field_name] = ErrorList(composite._errors)
1329384
def form_invalid(self, form):
        
        meta = getattr(self.model, '_meta')

        #noinspection PyUnresolvedReferences
        messages.error(
            self.request,
            _(u'The {0} could not be saved due to errors.').format(
                meta.verbose_name.lower()
            )
        )

        return super(BaseEditView, self).form_invalid(form)
1140463
private void updateErrors() {
		boolean oldErrors = hasErrors;
		hasErrors = false;
		if (validationResults.getHasErrors()) {
			hasErrors = true;
		}
		else {
			Iterator childIter = children.iterator();
			while (childIter.hasNext()) {
				ValidationResultsModel childModel = (ValidationResultsModel) childIter.next();
				if (childModel.getHasErrors()) {
					hasErrors = true;
					break;
				}
			}
		}
		firePropertyChange(HAS_ERRORS_PROPERTY, oldErrors, hasErrors);
	}
1329546
def forms_valid(self, forms):
        
        for form in six.itervalues(forms):
            form.save()
        return super(MultiModelFormView, self).forms_valid(forms)
1156202
def post(self, request, *args, **kwargs):
        
        self.object = self.get_object()
        self.get_context_data()
        inlines = self.construct_inlines()

        if all_valid(inlines):
            return self.forms_valid(inlines)
        return self.forms_invalid(inlines)
715352
def handle_invalid_value(self, message, exc_info, context):
        # type: (Text, bool, dict) -> Any
        
        raise NotImplementedError(
            'Not implemented in {cls}.'.format(cls=type(self).__name__),
        )