Fix issue in CCE UPDATE operation

select-best-date v0.1.0
Mike Benowitz 2019-07-09 13:14:55 -04:00
parent 5cf334a029
commit 58b8cb30e8
1 changed files with 7 additions and 3 deletions

View File

@ -137,11 +137,11 @@ class CCE(Core, Base):
def updateRegistrations(self, registrations):
existingRegs = [
self.updateReg(r, registrations) for r in self.registrations
if r.regnum in [ r['regnum'] for r in registrations ]
if r.regnum in [ n['regnum'] for n in registrations ]
]
newRegs = [
r for r in registrations
if r['regnum'] not in [ r.regnum for r in existingRegs ]
if r['regnum'] not in [ n.regnum for n in existingRegs ]
]
self.registrations = existingRegs + [
Registration(
@ -155,7 +155,11 @@ class CCE(Core, Base):
def updateReg(self, reg, registrations):
newReg = CCE.getReg(reg.regnum, registrations)
reg.update(newReg)
if newReg: reg.update(newReg)
return reg
def setParentCCE(self, parentID):
self.parent_cce_id = parentID
@staticmethod
def getReg(regnum, newRegs):