Commit 0aae16f6 authored by Enrico Zini's avatar Enrico Zini
Browse files

Ensure nullable fields are null, not empty strings

parent 25260279
......@@ -134,6 +134,14 @@ class Person(models.Model):
else:
return "%s %s %s" % (self.cn, self.mn, self.sn)
def save(self, *args, **kwargs):
"""
Convert empty strings to NULLs
"""
if not self.uid: self.uid = None
if not self.fpr: self.fpr = None
super(Person, self).save(*args, **kwargs)
def __unicode__(self):
return u"%s <%s>" % (self.fullname, self.email)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment