Questions tagged [validationerror]
The errors encountered during validating the data input.
192
questions
96
votes
7
answers
103k
views
Raise a validation error in a model's save method in Django
I'm not sure how to properly raise a validation error in a model's save method and send back a clear message to the user.
Basically I want to know how each part of the "if" should end, the one where ...
26
votes
5
answers
84k
views
Django, show ValidationError in template
I create a registation app, where users can register providing a username, email and a password. What I did is make sure that the email field is unique(as you can see in the code below). But I can't ...
18
votes
4
answers
41k
views
How to show validation errors using redirect in codeigniter?
I have been dealing with a problem for a while. How can I set the validation errors using redirect in a function? This is the code I have in my controller :
function send()
{
$this->...
13
votes
1
answer
19k
views
PyTorch: Add validation error in training
I am using PyTorch to train a cnn model. Here is my Network architecture:
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init ...
10
votes
4
answers
7k
views
Okay to Paste-in Package-Lock.json from 19 Hours Ago to Fix "ValidationError: Progress Plugin Invalid Options" (Vue 3)?
I'm using Vue 3 and I pushed a version of my project that was working well to GitHub 19 hours ago.
About 5 hours later, the problem below occurred when I entered npm run serve which resulted in these ...
9
votes
3
answers
14k
views
How to Highlight Fields on Rails Validation Errors
How do you display form field highlighting for fields that fail validation errors in Rails 3.1? I know that scaffolding automatically generates the css and controller code to handle this, but I was ...
8
votes
3
answers
10k
views
ValidationError when creating a SageMaker Model
I'm new to AWS and trying to build a model (from the web console) by referring to their demo. However, when I try to create the model, it gives me the below error.
Could not access model data at
...
6
votes
1
answer
2k
views
using f:viewParam with required attribute and commands
I want to share my experience using primefaces, f:viewParam and p:commandButton, and ask a few questions.Take a look at this page:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
&...
5
votes
1
answer
8k
views
Python Marshmallow: Dict validation Error
I'm quite new to marshmallow but my question refers to the issue of handling dict-like objects. There are no workable examples in the Marshmallow documentation. I came across with a simple example ...
5
votes
1
answer
554
views
Ruby on Rails - JS Input token, an issue when validation fails
I have a company model which can have many tags. It works fine, but in one occasion it does not work. The occasion is when company model validation fails. After :render => 'edit' it does not show tags ...
5
votes
2
answers
2k
views
Codeigniter - Displaying individual error message for array fields
Have array of customers each with individual details. Here is a very SIMPLE example.
<input type="text" name="customer_names[]" />
In codeigniter, each customer_name is required
$this->...
4
votes
1
answer
4k
views
how to check a previous value on a django model
I've got a django model with a field that i want to be always greater than the previous one of the same model instance after an update, like this:
class MyModel(models.Model):
version = models....
4
votes
2
answers
9k
views
S3 access denied when trying to run aws cli
using the AWS CLI I'm trying to run
aws cloudformation create-stack --stack-name FullstackLambda --template-url https://s3-us-west-2.amazonaws.com/awsappsync/resources/lambda/LambdaCFTemplate.yam --...
4
votes
1
answer
5k
views
django admin delete objects in inlines in save_model method
I have two related (via foreignkey relation) models and created admin model for parent with inlines. In several cases (edited in admin by boolean field), i need to delete all previous objects (inlines)...
4
votes
1
answer
2k
views
Custom error message for Laravel validation rule: Dimensions
I'm trying to validate an image upload that looks like the following:
$this->validate($request, [
'admin_image'=> 'nullable|image|dimensions:min_width=600,min_height=600',
]);
when the ...
3
votes
2
answers
4k
views
"global name '_' is not defined" during raising ValidationError
I'm following django tutorial about raising ValidationError in Django.
Unfortunatelly even the simplest snippet won't work. I've added below code to my validator object:
raise ValidationError(_('...
3
votes
2
answers
2k
views
How to add an error message to the form in Zend Framework 2?
I have a complex Zend\Form with multiple nested Fieldsets. Now I need to implement a cross-Fieldset-validation. That means, the validation rule refers to multiple Elements from different Fieldsets. ...
3
votes
4
answers
9k
views
Django Model validate_unique method don't raise ValidationError
My model is :
class Inventory(models.Model):
canteen_id = models.IntegerField()
item = models.OneToOneField('Info',db_column='item_id')
I want item should be unique for each canteen_id. I ...
3
votes
1
answer
3k
views
CakePHP 3 and form validation errors
I use cakePHP 3 and I have a sign in form with Form->input().
If on purpose I make an error, this error doesn't whow up under the Form field. It doesn't appear anywhere.
My code is like this:
$...
3
votes
3
answers
5k
views
Validation.HasError does not trigger again if new error comes in while already true
I use MVVM and my object implement IDataErrorInfo. When a property is set, I run custom validation methods and if the validation passes, I return String.empty, which sets Validation.HasError to false....
3
votes
3
answers
16k
views
fragment was not found at expected path (eclipse jsp)
In eclipse, I have a javaproject (not a web project), though it does provide reusable tag files.
layout
+src
+++META-INF
----my.tld
+++++++++++tags
---------------include.jsp
I keep on getting ...
3
votes
2
answers
2k
views
Representing a validation error within a control that is not of the data-bound control?
I have a TextBlock within a DockPanel within a Border. The TextBlock is data-bound and can be changed with an on-screen keyboard. Therefore, I have hooked it up to validation and it works ...
3
votes
1
answer
854
views
django rest framweork: combine ValidationError from multiple validation
Let's say I have the following serializers:
class AnswerSerializer(ModelSerializer):
answer_text=CharField()
def validate_answer_text(self, value):
...
return value
def ...
3
votes
1
answer
1k
views
Prevent the DbContext from repeatedly trying to save bad data
I have a process that is importing an Excel Spreadhseet, and parsing the data into my data objects. The source of this data is very questionable, as we're moving our customer from a spreadsheet-based ...
2
votes
2
answers
4k
views
How to change the Validation Error behaviour for Dropwizard?
In Dropwizard I use @Valid annotations for my resource methods:
public class Address {
@NotNull
String street
...
}
@Path("/address")
@Produces(MediaType.APPLICATION_JSON)
public class ...
2
votes
1
answer
2k
views
Formatting ValidationError in View with Play Framework
I don't manage to access to the ValidationError message from my view.
The only output I manage to get in my view is :
[ValidationError(username,Too short, sorry ;),[6])]
[ValidationError(password,...
2
votes
2
answers
1k
views
ValidationError assertion not working when pytest shows the same values
I'm writing a unit test whereby I want to assert that the error I get:
<ValidationError: "'a list' is not of type 'array'">
is equal too
assert ValidationError(message="'a list' ...
2
votes
1
answer
1k
views
Create helpers function for displaying validation errors
To display validation errors after input field I using:
<div class="form-group">
{!! Html::decode(Form::label('first_name','First Name:<span class="required">*</span>',['class'=&...
2
votes
1
answer
4k
views
How to update DIV in _Layout.cshtml with message after Ajax form is submitted?
Currently I have a Razor View like this:
TotalPaymentsByMonthYear.cshtml
@model MyApp.Web.ViewModels.MyViewModel
@using (@Ajax.BeginForm("TotalPaymentsByMonthYear",
new { reportName = "...
2
votes
1
answer
3k
views
In flutter how can we make validation error messages look beautiful
I am making an application. The UI of login page i have shared. In this i used validation and due to that it shows validation message in red color below textformfield but it looks very ugly. Is there ...
2
votes
1
answer
1k
views
struts2 validation using message store interceptor
consider this:
user clicks on a link
request goes to DisplayLoginAction
Login.jsp is displayed
user enters his credentials
form is mapped to ValidateLoginAction
validation fails in ...
2
votes
1
answer
3k
views
Name Duplication Validation
I trying in the following way a custom validation so that when a duplicate name is put in the input to the array of objects defined in the ts, the message that the name already exists in the mat-error ...
2
votes
1
answer
677
views
Error validating exception when using System.Reflection
We're developing a SharePoint webpart as a sandboxed solution in Visual Studio 2013 for SharePoint Online. We use an external dll library iTextSharp for reading and writing to PDF. We are having a ...
2
votes
0
answers
573
views
Missing data for required field in Marshmallow 3.10.0
I am new to Marshmallow (3.10.0) and I am lost and need help trying to figure out what causes the following error:
AssertionError: ["Input Error - exten: ['Missing data for required field.']&...
2
votes
0
answers
502
views
Django Form DecimalField Min value validation error
I am working on Django form with a Decimal Field, in the form class:
I have :
field1= forms.DecimalField(required=False, max_digits=3, decimal_places=2, max_value=1.0, min_value=0.1)
when I set the ...
2
votes
1
answer
122
views
ValidationError doesn't get printed in my web
I've been learning django for two weeks now and I'm currently learning raising forms.Errors such as forms.ValidationError.
Here's the code I've written:
def clean_email(self, *args, **kwargs):
...
2
votes
2
answers
764
views
Django ValidationError after javascript modifies the choice field
I'm working on a job scheduling app for a REST API and I've created a Tasks, Nodes, URL, Adom, BaseOptions, and Jobs tables in Django. The BaseOptions have a foreign key for src_adom and dst_adom and ...
2
votes
0
answers
190
views
CakePHP keep data form after validation error
When I got a password validation error I show the text error in the head of my page so I want to keep my fileds data even if I have an validation error.
I am using redirect so there is another way ...
2
votes
0
answers
377
views
django-autocomplete-light modelform ValidationError
I have an autocomplete fields in 2 diferent forms.
One is with forms.Form and works ok.
Other one is with ModelForm and this doesn't work
If I try with:
class FacturaForm(ModelForm):
class ...
1
vote
2
answers
2k
views
Django's loaddata giving ValidationError on valid date
I'm trying to use fixtures in Django to provide some initial data to one of my projects. The model that I want to provide this data to has a DateField named 'added'. So in the JSON file that contains ...
1
vote
2
answers
3k
views
Django is_valid() throws ValueError when submitting a form. Not sure why
The following code creates a form based on a model, Post. Problem I am facing is that the form never validates and gives ValueError that data did not validate if I remove the if post_form.is_valid(): ...
1
vote
1
answer
4k
views
ASP.NET MVC: field is present but validation error says "Field is required"
Summary:
When I want to update a Model instance inside database it cause validation error Field is required for Client field (Altough field is filled before saving and is not empty when I trace ...
1
vote
1
answer
6k
views
Yup: How to access the "inner" propriety in ValidationError() method
Yup contain a method name validationError whose one of properties is "inner". Accordingly with the documentation:
in the case of aggregate errors, inner is an array of ValidationErrors
...
1
vote
1
answer
167
views
Can't seem able to show validation errors on rails
I've been reading rails and ruby tutorials and just got started with my first project. Everything is going well but I'm having a problem showing validation errors for new users. This is my controller ...
1
vote
1
answer
938
views
Extract Pydantic ValidationError message
How do I extract just the msg value from a Pydantic ValidationError object?
I tried with:
json.loads(ValidationError_obj.json()[]['msg'])
But I am trying to find some simple built-in method.
1
vote
2
answers
794
views
nhandledPromiseRejectionWarning: ValidationError: user validation failed: password: Path `password` is required
I'm trying to register users using node and mongo but I get this ValidationError:
unhandledPromiseRejectionWarning: ValidationError: user validation failed: password: Path password is required., ...
1
vote
2
answers
734
views
"Path 'hashed_password' is required" even though hash_password field is full when using virtual field
I am trying to create an app where the password is sent into a virtual field, then hashed and stored as a hash. However I keep getting this error:
(node:32101) UnhandledPromiseRejectionWarning: ...
1
vote
1
answer
5k
views
AWS DynamoDB NodeJS Transactions - Trying to create 'move' with Put & Delete but ValidationError
I'm trying to do a simple transactional 'move' of data from one table to another in DynamoDB (to add indexes). Here's the call I'm making, the promise is returned because I'm using .then() to ...
1
vote
1
answer
645
views
Wagtail raises ValidationError on page update
On publishing updates to an existing wagtail page it raises a ValidationError with the message below.
ValidationError({'live_revision': ['page revision instance with id 33 does not exist.']})
All ...
1
vote
1
answer
11k
views
HTTP Status 500 - Handler processing failed; nested exception is java.lang.AbstractMethodError:
Please help me with learning the basics of Spring 3 MVC better, I was trying to learn about Spring JSR 303: Bean Validation and could not solve the below problem at all, I have spent over a day on ...