Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
production
building-knowledge-centre
building-dao
Commits
14a78200
Commit
14a78200
authored
Oct 22, 2019
by
Marc-Andre Santune
Browse files
Handle case where operation history was not already defined before
parent
e71616f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
building_dao/building_generic.py
building_dao/building_generic.py
+9
-2
No files found.
building_dao/building_generic.py
View file @
14a78200
...
...
@@ -68,12 +68,19 @@ class BuildingGeneric:
def
update_status_history
(
self
,
status
:
str
)
->
None
:
"""
u
pdate the history
U
pdate the history
.
Note: the retries for conflict error are managed within BKC API
"""
if
self
.
_building
.
get
(
"operation_history"
)
is
None
:
operation_history
=
[
status
]
# Init the history if did not already exist
else
:
operation_history
=
[
*
self
.
_building
.
get
(
"operation_history"
),
status
]
payload
=
{
"operation_history"
:
[
*
self
.
_building
.
get
(
"
operation_history
"
),
status
]
"operation_history"
:
operation_history
}
self
.
_req
(
"put"
,
join
(
self
.
settings
.
base_url
,
self
.
_uid
),
json
=
{
**
payload
})
def
register_error_for_building
(
self
,
error_code
:
str
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment