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