Opened 5 years ago

Closed 5 years ago

#16060 closed Bug (invalid)

Model entry does not get verified and no error raised

Reported by: m.vovcu@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:



class DestMail(models.Model):

user = models.ForeignKey(User)

mail = models.EmailField()

class Meta:

unique_together = (("user", "mail"),)

def unicode(self):

return self.mail

First of all, even on the command line you can enter anything in the mail-field. No verification.

While used this code:

## user defined, mail defined

m, created = DestMail.objects.get_or_create(user=user,mail=mail)

Object got created even if it existed. Neither "unique_together" does help.

I have to check anytime something is entered if it's not blank, because even blank entries got entered. Although there is no "blank=True" directive.

Didn't seem to have that problem with previous Django release. That's all I noticed so far.


Change History (1)

comment:1 Changed 5 years ago by Matt McClanahan

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: invalid
Status: newclosed
Type: UncategorizedBug

Model validation does not happen automatically when you're manipulating a model object directly. See

Note: See TracTickets for help on using tickets.
Back to Top