Skip to content

Commit

Permalink
added detectiontypes PUT updater
Browse files Browse the repository at this point in the history
  • Loading branch information
nicburgt committed Dec 7, 2020
1 parent d017a59 commit aa1ed9a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions back-end/resources/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ def put(self, config_ID):
else:
# Update entity based on JSON data
json_data = request.get_json(force=True)
detectiontypes = json_data['detection_types']

# Wipe detection types and re set them based on the given detectiontypes
configuration.detections.clear()
for item in detectiontypes:
dt = DetectionTypes(detectionType=item)
config.detections.append(dt)

configuration.name = json_data['name']
configuration.resolution = json_data['resolution']
configuration.drawables = json_data['drawables']
Expand Down

0 comments on commit aa1ed9a

Please sign in to comment.