Skip to content

Commit

Permalink
Remove unused "Flask-Login" dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Oct 25, 2016
1 parent 13769ab commit b84bfdd
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 94 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
'flask==0.10.1',
'werkzeug==0.9.6',
'Flask-Babel==0.9',
'Flask-Login==0.2.9',
'Flask-Cache==0.12',
'Flask-Migrate==1.2.0',
'Flask-Script==0.6.7',
Expand Down
6 changes: 0 additions & 6 deletions skylines/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ def add_cache(self):
from skylines.frontend.cache import cache
cache.init_app(self)

def add_login_manager(self):
""" Create and attach Login extension """
from skylines.frontend.login import login_manager
login_manager.init_app(self)

def add_logging_handlers(self):
if self.debug: return

Expand Down Expand Up @@ -93,7 +88,6 @@ def create_frontend_app(*args, **kw):

app.add_cache()
app.load_egm96()
app.add_login_manager()

oauth.init_app(app)

Expand Down
23 changes: 0 additions & 23 deletions skylines/frontend/login.py

This file was deleted.

2 changes: 0 additions & 2 deletions skylines/frontend/views/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from .errors import register as register_error_handlers
from .i18n import register as register_i18n
from .login import register as register_login

from .about import about_blueprint
from .airport import airport_blueprint
Expand Down Expand Up @@ -30,7 +29,6 @@
def register(app):
register_error_handlers(app)
register_i18n(app)
register_login(app)

app.register_blueprint(assets_blueprint)
app.register_blueprint(files_blueprint)
Expand Down
46 changes: 0 additions & 46 deletions skylines/frontend/views/login.py

This file was deleted.

17 changes: 1 addition & 16 deletions skylines/lib/decorators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from functools import wraps

from flask import current_app, request, jsonify
from flask.ext.login import current_user
from flask import current_app, request


def jsonp(func):
Expand All @@ -17,17 +16,3 @@ def decorated_function(*args, **kwargs):
else:
return func(*args, **kwargs)
return decorated_function


class login_required:
def __init__(self, msg=None):
self.msg = msg

def __call__(self, fn):
@wraps(fn)
def decorated_view(*args, **kwargs):
if not current_user.is_authenticated():
return jsonify(), 401

return fn(*args, **kwargs)
return decorated_view

0 comments on commit b84bfdd

Please sign in to comment.