Commit ff2706b6 authored by EKbfh's avatar EKbfh 🐼
Browse files

Fix migration for all logins

parent 812f0b90
Pipeline #28519 passed with stages
in 2 minutes and 23 seconds
......@@ -44,11 +44,11 @@ def migrate(migrator):
if len(Environment.select()) != 0:
for env in Environment.select():
print("Migrating %s" % env.name)
s = Service.select().where(Service.environment == env.id,
Service.service == "login")
conf = yaml.full_load(s[0].config)
for s in Service.select().where(Service.environment == env.id):
if s.service == "login":
conf = yaml.full_load(s.config)
if "session_ttl" in conf:
if "d" not in str(conf["session_ttl"]):
conf["session_ttl"] = str(conf["session_ttl"]) + "d"
s[0].config = json.dumps(conf, sort_keys=True)
s[0].save()
s.config = json.dumps(conf, sort_keys=True)
s.save()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment