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
5a11ae71
Commit
5a11ae71
authored
Nov 17, 2020
by
unknown
Browse files
update update_status_history
parent
07649680
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
building_dao/building_generic.py
building_dao/building_generic.py
+7
-3
No files found.
building_dao/building_generic.py
View file @
5a11ae71
...
@@ -131,9 +131,13 @@ class BuildingGeneric:
...
@@ -131,9 +131,13 @@ class BuildingGeneric:
Note: the retries for conflict error are managed within BKC API
Note: the retries for conflict error are managed within BKC API
Do not update history if the status is already in there
Do not update history if the status is already in there
"""
"""
if
status
not
in
self
.
_building
[
"operation_history"
]:
payload
=
{
"new_entry"
:
status
}
payload
=
{
"new_entry"
:
status
}
url
=
"/"
.
join
([
self
.
settings
.
base_url
,
self
.
_uid
,
"history"
])
url
=
"/"
.
join
([
self
.
settings
.
base_url
,
self
.
_uid
,
"history"
])
if
self
.
_building
[
"operation_history"
]
is
None
:
return
self
.
_req_with_retries
(
method
=
"put"
,
url
=
url
,
json
=
payload
,
**
kwargs
)
elif
status
not
in
self
.
_building
[
"operation_history"
]:
return
self
.
_req_with_retries
(
method
=
"put"
,
url
=
url
,
json
=
payload
,
**
kwargs
)
return
self
.
_req_with_retries
(
method
=
"put"
,
url
=
url
,
json
=
payload
,
**
kwargs
)
def
register_error_for_building
(
self
,
error_code
:
str
):
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