Skip to content

Commit

Permalink
Update checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswhitfield committed Apr 29, 2024
1 parent 1f76c73 commit 1cf4a99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dasmon_app/dasmon_listener/amq_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ def on_message(self, frame):
# elif 'timestamp' in data_dict:
# timestamp = data_dict['timestamp']
for key in data_dict:
if key == "monitors" and type(data_dict[key]) == dict:
if key == "monitors" and isinstance(data_dict[key], dict):
for item in data_dict[key]:
# Protect against old API
if not type(data_dict[key][item]) == dict:
if not isinstance(data_dict[key][item], dict):
key_id = self.retrieve_parameter("monitor_count_%s" % str(item))
store_and_cache(
instrument,
Expand Down
2 changes: 1 addition & 1 deletion src/webmon_app/reporting/dasmon/view_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ def get_signals(instrument_id):
if len(latests) == 0:
latests = PVStringCache.objects.filter(instrument=instrument_id, name=item.pv_name)
latest = latests.latest("update_time")
if type(latest.value) == float:
if isinstance(latest.value, float):
value = "%g" % latest.value
else:
value = "%s" % latest.value
Expand Down
2 changes: 1 addition & 1 deletion src/webmon_app/reporting/reduction/view_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def send_template_request(instrument_id, template_dict, user="unknown"):
"""
use_default = False
if "use_default" in template_dict:
if type(template_dict["use_default"]) == bool:
if isinstance(template_dict["use_default"], bool):
use_default = template_dict["use_default"]
else:
use_default = template_dict["use_default"].lower() == "true"
Expand Down

0 comments on commit 1cf4a99

Please sign in to comment.