fossasia / open-event-server

Unused nested function or class detected PTC-W0065
Anti-pattern
Major
5 occurrences in this check
handle_exception is not used inside function create_app
221            {'Content-Type': 'application/vnd.api+json'},
222        )
223
224    @app.errorhandler(ErrorResponse)225    def handle_exception(error: ErrorResponse):
226        return error.respond()
227
ratelimit_handler is not used inside function create_app
213            exc = ErrorResponse('Unknown error')
214        return exc.respond()
215
216    @app.errorhandler(429)217    def ratelimit_handler(error):
218        return make_response(
219            json.dumps({'status': 429, 'title': 'Request Limit Exceeded'}),
internal_server_error is not used inside function create_app
205        if current_user.is_authenticated:
206            current_user.update_lat()
207
208    @app.errorhandler(500)209    def internal_server_error(error):
210        if app.config['PROPOGATE_ERROR'] is True:
211            exc = ErrorResponse(str(error))
track_user is not used inside function create_app
200    health.add_check(health_check_migrations)
201
202    # http://stackoverflow.com/questions/26724623/
203    @app.before_request204    def track_user():
205        if current_user.is_authenticated:
206            current_user.update_lat()
get_locale is not used inside function create_app
 84    # Babel
 85    babel = Babel(app)
 86
 87    @babel.localeselector 88    def get_locale():
 89        # Try to guess the language from the user accept
 90        # header the browser transmits. We support de/fr/en in this