Skip to content

Commit

Permalink
keep workaround for JSON upload for now
Browse files Browse the repository at this point in the history
  • Loading branch information
HLFH committed Nov 17, 2022
1 parent 9f6439f commit 53912b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions automua/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def populate_with_example_data():
def populate_with_dict(config: dict) -> None:
name: str = config['provider']
short_name = name.split(' ')[0]
pid = db.session.scalar(select(func.count()).select_from(Provider))
pid = db.session.scalar(select(func.count()).select_from(Provider)) + 1
provider = Provider(id=pid, name=name, short_name=short_name)
db.session.add(provider)
domains = []
did = db.session.scalar(select(func.count()).select_from(Domain))
did = db.session.scalar(select(func.count()).select_from(Domain)) + 1
for domain in config['domains']:
domains.append(Domain(id=did, name=domain, provider=provider))
did += 1
Expand All @@ -133,7 +133,7 @@ def populate_with_dict(config: dict) -> None:
return
db.session.add_all(domains)
servers = []
sid = db.session.scalar(select(func.count()).select_from(Server))
sid = db.session.scalar(select(func.count()).select_from(Server)) + 1
for server in config['servers']:
name = server['name']
type_ = server['type']
Expand Down

0 comments on commit 53912b1

Please sign in to comment.