diff options
author | Filipp Lepalaan <filipp@mac.com> | 2015-08-17 00:05:23 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2015-08-17 00:05:23 +0300 |
commit | 8565e4dc0b7acd16078700c03031beca8d26be77 (patch) | |
tree | 014035d543dfa8de7d9b1c9407daf54a89ac4f67 /servo/models | |
parent | 424bfdb617003dc8cddc4c10afb64583824341db (diff) | |
download | Servo-8565e4dc0b7acd16078700c03031beca8d26be77.tar.gz Servo-8565e4dc0b7acd16078700c03031beca8d26be77.tar.bz2 Servo-8565e4dc0b7acd16078700c03031beca8d26be77.zip |
Misc fixes
Diffstat (limited to 'servo/models')
-rw-r--r-- | servo/models/device.py | 8 | ||||
-rw-r--r-- | servo/models/repair.py | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/servo/models/device.py b/servo/models/device.py index ea719a3..993b96b 100644 --- a/servo/models/device.py +++ b/servo/models/device.py @@ -342,9 +342,11 @@ class Device(models.Model): serial_number = wty.serialNumber or sn device = Device(sn=serial_number) - if device.notes == '': - device.notes = wty.notes or '' - device.notes += wty.csNotes or '' + from servo.lib.utils import empty + + if empty(device.notes): + device.notes = wty.notes or '' + device.notes += wty.csNotes or '' device.has_onsite = product.has_onsite device.is_vintage = product.is_vintage diff --git a/servo/models/repair.py b/servo/models/repair.py index 345b69f..8d9ffab 100644 --- a/servo/models/repair.py +++ b/servo/models/repair.py @@ -220,14 +220,14 @@ class Repair(models.Model): def get_symptom_code_choices(self): # @fixme: what if it's someone else ordering the part? self.gsx_account.connect(self.created_by) - ckey = 'symptom_codes-' + self.device.sn + ckey = 'symptom_codes-%s' % self.device.sn si = SymptomIssue(serialNumber=self.device.sn) return cache_getset(ckey, si.fetch) def get_issue_code_choices(self): # @fixme: what if it's someone else ordering the part? self.gsx_account.connect(self.created_by) - ckey = 'issue_codes-' + self.symptom_code + ckey = 'issue_codes-%s' % self.symptom_code si = SymptomIssue(reportedSymptomCode=self.symptom_code) return cache_getset(ckey, si.fetch) |