Skip to content
This repository has been archived by the owner on Jun 21, 2021. It is now read-only.

Commit

Permalink
Fix for RQ Dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Jun 15, 2017
1 parent fac003f commit 573b77c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions hascore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-

from functools import partial
from flask import Flask
from flask import Flask, abort
from flask_migrate import Migrate
from flask_assets import Bundle
from flask_lastuser import Lastuser
from flask_lastuser.sqlalchemy import UserManager
from rq_dashboard import RQDashboard
import rq_dashboard
from baseframe import baseframe, assets
import coaster.app

Expand All @@ -22,6 +21,7 @@


# Configure the app
app.config.from_object(rq_dashboard.default_settings)
coaster.app.init_app(app)
db.init_app(app)
db.app = app
Expand All @@ -37,4 +37,6 @@
Bundle(assets.require('baseframe-networkbar.css'),
filters='cssmin', output='css/baseframe-networkbar.css'))

RQDashboard(app, url_prefix='/rq', auth_handler=partial(lastuser.has_permission, 'siteadmin'))
# RQDashboard(app, url_prefix='/rq', auth_handler=partial(lastuser.has_permission, 'siteadmin'))
rq_dashboard.blueprint.before_request(lambda: None if lastuser.has_permission('siteadmin') else abort(403))
app.register_blueprint(rq_dashboard.blueprint, url_prefix="/rq")
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ nltk
numpy
requests
unidecode
rq-dashboard
rq-dashboard>=0.3.8
Flask-Migrate

0 comments on commit 573b77c

Please sign in to comment.