Changeset 13300 for trunk


Ignore:
Timestamp:
08/24/11 12:19:31 (13 years ago)
Author:
sil
Message:

Fixed a bug in model WarrantyContract?. When field contract_number was kept blank, it wasn't stored in the database as None

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sara_cmt/sara_cmt/cluster/models.py

    r13073 r13300  
    652652    def __unicode__(self):
    653653        return self.label
     654
     655    def save(self, force_insert=False, force_update=False):
     656        """
     657            The contract number is an optional field, but when filled in it
     658            should have a unique value. When kept blank, it should be stored as
     659            None.
     660        """
     661        if not self.contract_number:
     662            self.contact_number = None
Note: See TracChangeset for help on using the changeset viewer.