aboutsummaryrefslogtreecommitdiff
path: root/db_create.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-01-17 16:50:38 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-03-03 22:22:14 +0100
commit2849c82255b4b889c7342a0a8fa8a4aecfbe599d (patch)
tree3ad31fd3a0e84bc3f40367cf4963cf8db8c65d06 /db_create.py
parentadding news fields and migrations scripts (diff)
downloadnewspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.tar.gz
newspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.tar.bz2
newspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.zip
a first big refacto of the existing arch
Diffstat (limited to 'db_create.py')
-rwxr-xr-xdb_create.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/db_create.py b/db_create.py
index 8e743515..c10e4d43 100755
--- a/db_create.py
+++ b/db_create.py
@@ -10,8 +10,8 @@ __license__ = "AGPLv3"
import os
import bootstrap
+from flask import g
-from pyaggr3g470r import db
from pyaggr3g470r.models import User, Role
from werkzeug import generate_password_hash
@@ -64,8 +64,8 @@ def db_DropEverything(db):
trans.commit()
-db_DropEverything(db)
-db.create_all()
+db_DropEverything(g.db)
+g.db.create_all()
role_admin = Role(name="admin")
role_user = Role(name="user")
@@ -76,5 +76,5 @@ user1 = User(nickname="admin",
activation_key="")
user1.roles.extend([role_admin, role_user])
-db.session.add(user1)
-db.session.commit()
+g.db.session.add(user1)
+g.db.session.commit()
bgstack15