Skip to content

Commit 06e30ab

Browse files
committed
Merge
2 parents 0450441 + 2f2d449 commit 06e30ab

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

utils/database.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setup_db():
1414
con = sqlite3.connect('vocably.db')
1515

1616
with con:
17-
cur = con.cursor()
17+
cur = con.cursor()
1818

1919
cur.execute("SELECT * FROM sqlite_master WHERE type='table' AND name='Users';")
2020
rows = cur.fetchall()
@@ -68,7 +68,7 @@ def get_score(email):
6868
con = sqlite3.connect('vocably.db')
6969

7070
with con:
71-
cur = con.cursor()
71+
cur = con.cursor()
7272
query = 'SELECT score FROM Users WHERE email="'+email+'";'
7373
cur.execute(query)
7474
rows = cur.fetchall()
@@ -78,7 +78,7 @@ def store_user_words(email,words):
7878
con = sqlite3.connect('vocably.db')
7979

8080
with con:
81-
cur = con.cursor()
81+
cur = con.cursor()
8282

8383
for word in words:
8484
query = 'INSERT INTO Vocab VALUES("'
@@ -93,7 +93,7 @@ def wipe_db():
9393
if not os.path.isfile("vocably.db"):
9494
print "The database is not there to begin with!"
9595
return
96-
96+
9797
msg = "Are you 100% sure you want to wipe the database?\n"
9898
msg += "This will remote all data and is irreversible... (yes/no)\n"
9999
input_ = raw_input(msg).strip().lower()

utils/vocably.db

-6 KB
Binary file not shown.

vocably.db

24 KB
Binary file not shown.

vocably.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from bottle import route, run, debug, template, request, static_file, redirect
2-
from utils import vocably_oauth as oauth, score, definition
3-
from utils import database as db
42

3+
from utils import vocably_oauth as oauth, score, definition, database as db
54

65
# Landing Page
76
@route('/')
@@ -41,6 +40,7 @@ def login_callback():
4140
else:
4241
print "Successfully acquired an authentication token"
4342
oauth.authorize(request.query.code)
43+
database.create_user(oauth.user_email(), 0)
4444
redirect('/emails')
4545

4646
@route('/emails')

0 commit comments

Comments
 (0)