Fix bug in upgrades API view, when upgrade has no status code
This commit is contained in:
parent
e4a518c444
commit
22ef6aad7b
|
@ -26,6 +26,8 @@ Tailbone Web API - Upgrade Views
|
|||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
import six
|
||||
|
||||
from rattail.db import model
|
||||
|
||||
from tailbone.api import APIMasterView
|
||||
|
@ -40,8 +42,8 @@ class UpgradeView(APIMasterView):
|
|||
'created': upgrade.created.isoformat(),
|
||||
'description': upgrade.description,
|
||||
'enabled': upgrade.enabled,
|
||||
# 'status_code': upgrade.status_code,
|
||||
'status_code': self.enum.UPGRADE_STATUS[upgrade.status_code],
|
||||
'status_code': self.enum.UPGRADE_STATUS.get(upgrade.status_code,
|
||||
six.text_type(upgrade.status_code)),
|
||||
'executed': upgrade.executed.isoformat() if upgrade.executed else None,
|
||||
# 'executed_by':
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue