Ticket #1511: manipulators-bool-changed.diff

File manipulators-bool-changed.diff, 983 bytes (added by dummy@…, 18 years ago)

solution: don't check str()-values, check real values instead

  • manipulators.py

     
    109109        if self.change:
    110110            self.fields_added, self.fields_changed, self.fields_deleted = [], [], []
    111111            for f in self.opts.fields:
    112                 if not f.primary_key and str(getattr(self.original_object, f.attname)) != str(getattr(new_object, f.attname)):
     112                if type(getattr(new_object, f.attname)) is bool:
     113                    if not f.primary_key and getattr(self.original_object, f.attname) != getattr(new_object, f.attname):
     114                        self.fields_changed.append(f.verbose_name)
     115                elif not f.primary_key and str(getattr(self.original_object, f.attname)) != str(getattr(new_object, f.attname)):
    113116                    self.fields_changed.append(f.verbose_name)
    114117
    115118        # Save many-to-many objects. Example: Set sites for a poll.
Back to Top