Commit d6172e6c authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

models: Fix revision date for older series

Old series do not have a completion date for series which breaks posting

  File "patchwork/" in _on_test_result
    1083.                   'revision_completed': revision.completed.isoformat()}

  Exception Type: AttributeError at /api/1.0/series/71839/revisions/1/test-results/
  Exception Value: 'NoneType' object has no attribute 'isoformat'

Let's just admit that it's unknown.
Signed-off-by: default avatarArkadiusz Hiler <>
parent 5571d43e
Pipeline #96435 passed with stage
in 1 minute and 22 seconds
...@@ -1079,8 +1079,11 @@ def _on_test_result(sender, result, **kwargs): ...@@ -1079,8 +1079,11 @@ def _on_test_result(sender, result, **kwargs):
if revision: if revision:
series = revision.series series = revision.series
user = series.submitter.user user = series.submitter.user
revision_completed = "unknown"
if revision.completed:
revision_completed = revision.completed.isoformat()
params = {'revision': revision.version, params = {'revision': revision.version,
'revision_completed': revision.completed.isoformat()} 'revision_completed': revision_completed}
else: else:
series = None series = None
user = patch.submitter.user user = patch.submitter.user
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment