Skip to content

Commit

Permalink
set invalid address if blank (pgsql inet type problem)
Browse files Browse the repository at this point in the history
  • Loading branch information
justquick authored and diox committed Apr 29, 2010
1 parent b59afce commit 317ac55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mptt_comments/models.py
Expand Up @@ -33,6 +33,11 @@ class MpttComment(Comment):
title = models.CharField(max_length=60)
parent = models.ForeignKey('self', related_name='children', blank=True, null=True)

def save(self, *a, **kw):
if not self.ip_address:
self.ip_address = '0.0.0.0'
super(MpttComment, self).save(*a, **kw)

class Meta:
ordering = ('tree_id', 'lft')

Expand Down

0 comments on commit 317ac55

Please sign in to comment.