From 57caf52c024e3ecc0ee7014ff46b8aede030bba5 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 16 Jun 2023 11:55:21 +0200 Subject: [PATCH] fix initial id --- ereuse_devicehub/resources/device/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index ca7ea9be..c7950d1d 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -76,8 +76,8 @@ logger = logging.getLogger(__name__) def create_code(context): - _id = Device.query.order_by(Device.id.desc()).first() or 3 - if not _id == 3: + _id = Device.query.order_by(Device.id.desc()).first() or 1 + if not _id == 1: _id = _id.id + 1 return hashcode.encode(_id)