Skip to content

Commit 2395cb1

Browse files
author
Riley
committed
Add create_table function and update doc
1 parent 2e28796 commit 2395cb1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

website/app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def create_app(config=None):
1515
if 'WEBSITE_CONF' in os.environ:
1616
app.config.from_envvar('WEBSITE_CONF')
1717

18-
# load app sepcified configuration
18+
# load app specified configuration
1919
if config is not None:
2020
if isinstance(config, dict):
2121
app.config.update(config)
@@ -27,6 +27,11 @@ def create_app(config=None):
2727

2828

2929
def setup_app(app):
30+
# Create tables if they do not exist already
31+
@app.before_first_request
32+
def create_tables():
33+
db.create_all()
34+
3035
db.init_app(app)
3136
config_oauth(app)
3237
app.register_blueprint(bp, url_prefix='')

website/oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class AuthorizationCodeGrant(grants.AuthorizationCodeGrant):
15-
def create_authorization_code(self, client, user, request):
15+
def create_authorization_code(self, client, grant_user, request):
1616
code = gen_salt(48)
1717
item = OAuth2AuthorizationCode(
1818
code=code,

0 commit comments

Comments
 (0)