Skip to content

Commit

Permalink
minor compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaraMelih committed Nov 10, 2023
1 parent dabcb4a commit 9f5ee16
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions snews_cs/cs_remote_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,14 @@ def handle(self, CoincDeciderInstance):
else:
# if passed, there has to be an _id field
log.info(f"\t> Message is in SnewsFormat. '_id':{self.input_message['_id']} ")
try:
self.is_test = self.input_message['is_test']
except:
# temporary fix for the test messages
if "meta" in self.input_message.keys():
self.is_test = self.input_message['meta'].get('is_test', False)
else:
if "is_test" in self.input_message.keys():
self.is_test = self.input_message['is_test']
else:
self.is_test = False
log.info(f"\t> Received Message is {'NOT ' if not self.is_test else ''}a test message!")

# check what the _id field specifies
Expand Down

0 comments on commit 9f5ee16

Please sign in to comment.