fix initial id
This commit is contained in:
parent
c1d03e9525
commit
57caf52c02
|
@ -76,8 +76,8 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def create_code(context):
|
def create_code(context):
|
||||||
_id = Device.query.order_by(Device.id.desc()).first() or 3
|
_id = Device.query.order_by(Device.id.desc()).first() or 1
|
||||||
if not _id == 3:
|
if not _id == 1:
|
||||||
_id = _id.id + 1
|
_id = _id.id + 1
|
||||||
return hashcode.encode(_id)
|
return hashcode.encode(_id)
|
||||||
|
|
||||||
|
|
Reference in New Issue