﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12539	Error while validating non required IntegerField with localflavor form field	Bernd Schlapsi <brot@…>	nobody	"There is a validation error when validating a non required IntegerField and using a localflavor Field for the ModelForm

This is my example models.py
{{{
from django import forms
from django.contrib.localflavor.at.forms import ATZipCodeField
from django.db import models
   
class Person(models.Model):
    first_name = models.CharField(max_length=30)
    last_name = models.CharField(max_length=30)
    email = models.EmailField()
    zip = models.PositiveSmallIntegerField(blank=True, null=True)

class PersonForm(forms.ModelForm):
    zip = ATZipCodeField(required=False)

    class Meta:
        model = Person
}}}

This is how you can reproduce the error
{{{
In [1]: from app.models import PersonForm

In [2]: f = PersonForm({'first_name':'Max', 'last_name':'Mustermann', 'email':'a.b@test.com'})

In [3]: f.full_clean()

In [4]: f.errors
Out[4]: {'zip': [u'This value must be a float.']}
}}}"		closed	Database layer (models, ORM)	dev		worksforme			Accepted	1	0	0	0	0	0
