system user password migration, keep migration/data directory
This commit is contained in:
parent
96b209055a
commit
9a7e8076bb
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -135,7 +135,8 @@ discours.crt
|
|||
discours.pem
|
||||
Pipfile.lock
|
||||
|
||||
migration/data
|
||||
migration/data/*
|
||||
!migration/data/.gitkeep
|
||||
migration/content/**/*.md
|
||||
.obsidian
|
||||
|
||||
|
|
0
migration/data/.gitkeep
Normal file
0
migration/data/.gitkeep
Normal file
|
@ -98,6 +98,8 @@ def migrate(entry):
|
|||
session.query(User).filter(User.slug == user_dict["slug"]).first()
|
||||
)
|
||||
old_user.oid = oid
|
||||
old_user.password = user_dict["password"]
|
||||
session.commit()
|
||||
user = old_user
|
||||
if not user:
|
||||
print("[migration] ERROR: cannot find user " + user_dict["slug"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user