Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
ota_user: Fix off-by-one on max devices
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Doan <andy@foundries.io>
  • Loading branch information
doanac committed Apr 30, 2019
1 parent 074a9dc commit e6b1b5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ota_api/ota_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def max_devices(self):
def assert_device_quota(self):
"""Ensure that creating another device is allowed."""
maxd = self.max_devices
if maxd > 0 and len(list(self.device_list())) > maxd:
if maxd > 0 and len(list(self.device_list())) >= maxd:
message = 'MAX_DEVICES(%d) exceeded' % self.max_devices
abort(make_response(jsonify(message=message), 403))

Expand Down

0 comments on commit e6b1b5f

Please sign in to comment.