Skip to content

Commit

Permalink
Merge branch 'master' into slice_permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
sidgupta committed Apr 18, 2016
2 parents 7afc5fe + badcd8b commit 23303dd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
4 changes: 3 additions & 1 deletion caravel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
from flask.ext.cache import Cache
from flask.ext.migrate import Migrate

VERSION = '0.8.8'
from caravel import version

VERSION = version.VERSION_STRING

APP_DIR = os.path.dirname(__file__)
CONFIG_MODULE = os.environ.get('CARAVEL_CONFIG', 'caravel.config')
Expand Down
7 changes: 7 additions & 0 deletions caravel/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
VERSION_MAJOR = 0
VERSION_MINOR = 8
VERSION_BUILD = 8
VERSION_INFO = (VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD)
VERSION_STRING = "%d.%d.%d" % VERSION_INFO

__version__ = VERSION_INFO
10 changes: 9 additions & 1 deletion caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,13 @@ def dashboard(**kwargs): # noqa
@expose("/sql/<database_id>/")
@log_this
def sql(self, database_id):
if (
not self.appbuilder.sm.has_access(
'all_datasource_access', 'all_datasource_access')):
flash(
"This view requires the `all_datasource_access` "
"permission", "danger")
return redirect("/tablemodelview/list/")
mydb = db.session.query(
models.Database).filter_by(id=database_id).first()
engine = mydb.get_sqla_engine()
Expand Down Expand Up @@ -798,7 +805,8 @@ def runsql(self):
if (
not self.appbuilder.sm.has_access(
'all_datasource_access', 'all_datasource_access')):
raise Exception("test")
raise Exception(
"This view requires the `all_datasource_access` permission")
content = ""
if mydb:
eng = mydb.get_sqla_engine()
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import imp, os
from setuptools import setup, find_packages

VERSION = '0.8.8'

version = imp.load_source(
'version', os.path.join('caravel', 'version.py'))

setup(
name='caravel',
description=(
"A interactive data visualization platform build on SqlAlchemy "
"and druid.io"),
version=VERSION,
version=version.VERSION_STRING,
packages=find_packages(),
include_package_data=True,
zip_safe=False,
Expand Down Expand Up @@ -41,5 +42,5 @@
author_email='maximebeauchemin@gmail.com',
url='https://github.com/airbnb/caravel',
download_url=(
'https://github.com/airbnb/caravel/tarball/' + VERSION),
'https://github.com/airbnb/caravel/tarball/' + version.VERSION_STRING),
)

0 comments on commit 23303dd

Please sign in to comment.