fix initial id

This commit is contained in:
Cayo Puigdefabregas 2023-06-16 11:55:21 +02:00
parent c1d03e9525
commit 57caf52c02
1 changed files with 2 additions and 2 deletions

View File

@ -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)