Skip to content

Commit

Permalink
Ensure that artifacts have a timestamp before giving them the timelin…
Browse files Browse the repository at this point in the history
…e_timestamp property
  • Loading branch information
sarah256 committed Jun 24, 2019
1 parent 2af8bd7 commit 389cb90
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion estuary/models/bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def display_name(self):
@property
def timeline_timestamp(self):
"""Get the DateTime property used for the Estuary timeline."""
return self.creation_time.strftime("%Y-%m-%dT%H:%M:%SZ")
if self.creation_time:
return self.creation_time.strftime('%Y-%m-%dT%H:%M:%SZ')
return None

@classmethod
def find_or_none(cls, identifier):
Expand Down
4 changes: 3 additions & 1 deletion estuary/models/distgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ def display_name(self):
@property
def timeline_timestamp(self):
"""Get the DateTime property used for the Estuary timeline."""
return self.commit_date.strftime("%Y-%m-%dT%H:%M:%SZ")
if self.commit_date:
return self.commit_date.strftime('%Y-%m-%dT%H:%M:%SZ')
return None
4 changes: 3 additions & 1 deletion estuary/models/errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def display_name(self):
@property
def timeline_timestamp(self):
"""Get the DateTime property used for the Estuary timeline."""
return self.created_at.strftime("%Y-%m-%dT%H:%M:%SZ")
if self.created_at:
return self.created_at.strftime('%Y-%m-%dT%H:%M:%SZ')
return None

@classmethod
def find_or_none(cls, identifier):
Expand Down
4 changes: 3 additions & 1 deletion estuary/models/freshmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def display_name(self):
@property
def timeline_timestamp(self):
"""Get the DateTime property used for the Estuary timeline."""
return self.time_created.strftime("%Y-%m-%dT%H:%M:%SZ")
if self.time_created:
return self.time_created.strftime('%Y-%m-%dT%H:%M:%SZ')
return None


class FreshmakerBuild(EstuaryStructuredNode):
Expand Down
4 changes: 3 additions & 1 deletion estuary/models/koji.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def display_name(self):
@property
def timeline_timestamp(self):
"""Get the DateTime property used for the Estuary timeline."""
return self.creation_time.strftime("%Y-%m-%dT%H:%M:%SZ")
if self.creation_time:
return self.creation_time.strftime('%Y-%m-%dT%H:%M:%SZ')
return None

@classmethod
def find_or_none(cls, identifier):
Expand Down

0 comments on commit 389cb90

Please sign in to comment.