Overridden hard_default
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-12-11 01:27:45 +01:00
parent ba8718054b
commit 67403c6f63

View File

@ -49,6 +49,7 @@ class AssignmentView(FlaskView):
device_id = request.json['device_id'] device_id = request.json['device_id']
schedule_store_key = f"SCHEDULED:{device_id}" schedule_store_key = f"SCHEDULED:{device_id}"
hard_default_assigned = False
target_site = redis_client.get(schedule_store_key) target_site = redis_client.get(schedule_store_key)
@ -63,6 +64,7 @@ class AssignmentView(FlaskView):
if not default_target: if not default_target:
default_target = current_app.config['DEFAULT_WHILE_NOT_DEFINED'][0] default_target = current_app.config['DEFAULT_WHILE_NOT_DEFINED'][0]
hard_default_assigned = True
if default_target: if default_target:
target_site = default_target target_site = default_target
@ -75,4 +77,14 @@ class AssignmentView(FlaskView):
current_app.config['DEVICE_TIMEOUT'] current_app.config['DEVICE_TIMEOUT']
) )
return jsonify(self._resolve_response(target_site)) resp = self._resolve_response(target_site)
# Ah yes, the finest of hacks...
if hard_default_assigned:
resp['hard_default'] = True # This will report true only the first time trough... but we could survive this
# de amugy ez az egész hard default csak felesleges faszverés, úgy is azután fogok mérni, hogy beállt a rendszer
# Meg amúgy is ez csak egy információs cucc volt, minek van használva??
# Asking myself...
return jsonify(resp)