Skip to content

Commit

Permalink
[models] Fix None error in UnappliedChange
Browse files Browse the repository at this point in the history
  • Loading branch information
msimacek committed Aug 30, 2017
1 parent cb31a53 commit 5e834a1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions koschei/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,17 +568,26 @@ class UnappliedChange(Base):

package_id = Column(ForeignKey('package.id', ondelete='CASCADE'),
index=True, nullable=False)
prev_evr = composite(
_prev_evr = composite(
RpmEVR,
prev_epoch, prev_version, prev_release,
comparator_factory=RpmEVRComparator,
)
curr_evr = composite(

@hybrid_property
def prev_evr(self):
return self._prev_evr if self.prev_version else None

_curr_evr = composite(
RpmEVR,
curr_epoch, curr_version, curr_release,
comparator_factory=RpmEVRComparator,
)

@hybrid_property
def curr_evr(self):
return self._curr_evr if self.curr_version else None


class BuildrootProblem(Base):
id = Column(Integer, primary_key=True)
Expand Down

0 comments on commit 5e834a1

Please sign in to comment.