Skip to content

Commit

Permalink
add troubleshooting link if there is a link
Browse files Browse the repository at this point in the history
  • Loading branch information
timifasubaa committed Feb 12, 2018
1 parent c20efbb commit 2c762f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,9 @@ class CeleryConfig(object):
TROUBLESHOOTING_LINK = ''

# This link should lead to a page with instructions on how to gain access to a
# Datasource. It will be placed at the bottom of permissions errors.
# Datasource. It will be placed at the bottom of permissions errors.
PERMISSION_INSTRUCTIONS_LINK = ''


# Integrate external Blueprints to the app by passing them to your
# configuration. These blueprints will get integrated in the app
BLUEPRINTS = []
Expand Down
9 changes: 5 additions & 4 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@
ACCESS_REQUEST_MISSING_ERR = __(
'The access requests seem to have been deleted')
USER_MISSING_ERR = __('The user seems to have been deleted')
perms_instruction_link = config.get("PERMISSION_INSTRUCTIONS_LINK")
perms_instruction_link = config.get('PERMISSION_INSTRUCTIONS_LINK')
if perms_instruction_link:
DATASOURCE_ACCESS_ERR = __(
"You don't have access to this datasource. <a href='{}'>How to gain access</a>"
.format(perms_instruction_link))
"You don't have access to this datasource. <a href='{}'>How to gain access.</a>"
.format(perms_instruction_link),
)
else:
DATASOURCE_ACCESS_ERR = __("You don't have access to this datasource")
DATASOURCE_ACCESS_ERR = __("You don't have access to this datasource")


def get_database_access_error_msg(database_name):
Expand Down

0 comments on commit 2c762f1

Please sign in to comment.