Add 'needs_push' field

This commit is contained in:
Danila Fedorin 2020-05-15 17:04:04 -07:00
parent 4976cd8b93
commit fba6aedfb3
2 changed files with 2 additions and 0 deletions

View File

@ -85,6 +85,7 @@ class BoundingBox(db.Model):
id = db.Column(db.Integer, primary_key=True)
collar_id = db.Column(db.Integer, db.ForeignKey('collar.id'))
num_points = db.Column(db.Integer)
needs_push = db.Column(db.Boolean)
coord0x = db.Column(db.Float(precision=10))
coord0y = db.Column(db.Float(precision=10))
coord1x = db.Column(db.Float(precision=10))

View File

@ -164,6 +164,7 @@ def collar_set_boundary(id):
if collar is None: abort(404)
new_boundary = flatten(request.json)
new_boundary.needs_push = True
if collar.boundary is not None:
db.session.delete(collar.boundary)
collar.boundary = new_boundary