Skip to content

Commit

Permalink
Fix bad rebase, get session from db.session.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Kyryliuk authored and mistercrunch committed Aug 11, 2016
1 parent 5ffe1f7 commit 5688246
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion caravel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def json_iso_dttm_ser(obj):
return val
if isinstance(obj, datetime):
obj = obj.isoformat()
if isinstance(obj, date):
elif isinstance(obj, date):
obj = obj.isoformat()
else:
raise TypeError(
Expand Down
2 changes: 2 additions & 0 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,8 @@ def sql_json(self):
sql = request.form.get('sql')
database_id = request.form.get('database_id')
schema = request.form.get('schema')
session = db.session()
mydb = session.query(models.Database).filter_by(id=database_id).first()

if not (self.can_access(
'all_datasource_access', 'all_datasource_access') or
Expand Down

0 comments on commit 5688246

Please sign in to comment.