Hardcoded reference cleaning
This commit is contained in:
parent
c188dda016
commit
e358da596b
|
@ -159,15 +159,19 @@ class QSO(models.Model):
|
|||
# find reference
|
||||
changed = False
|
||||
if self.refStr:
|
||||
refName = self.refStr.replace("-", "")
|
||||
if refName == "GX":
|
||||
refName = "DX"
|
||||
|
||||
# Old reference exists?
|
||||
if self.ref and self.ref.name != self.refStr:
|
||||
if self.ref and self.ref.name != refName:
|
||||
self.ref = None
|
||||
changed = True
|
||||
|
||||
if not self.ref:
|
||||
# find matching ref
|
||||
try:
|
||||
self.ref = Reference.objects.get(name=self.refStr)
|
||||
self.ref = Reference.objects.get(name=refName)
|
||||
changed = True
|
||||
except Reference.DoesNotExist:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue