Skip to content

Commit

Permalink
Removed flask-selfdoc from project.
Browse files Browse the repository at this point in the history
  • Loading branch information
HutsonJason authored and danmash committed Mar 29, 2023
1 parent d358644 commit 36b8aef
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 73 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ docs/_build/
~*
*~
*.pyc
/.idea/
.idea
.idea/
/.idea/
.idea
.idea/

#updated ontology files
Climate_Mind_Digraph_Test_Ont.json
Expand Down
7 changes: 1 addition & 6 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from sentry_sdk.integrations.flask import FlaskIntegration

from app import models
from app.extensions import db, migrate, login, cache, auto, jwt, limiter
from app.extensions import db, migrate, login, cache, jwt, limiter
from config import DevelopmentConfig


Expand All @@ -17,7 +17,6 @@ def create_app(config_class=DevelopmentConfig):
migrate.init_app(app, db)
login.init_app(app)
cache.init_app(app)
auto.init_app(app)
jwt.init_app(app)
limiter.init_app(app)

Expand Down Expand Up @@ -88,10 +87,6 @@ def create_app(config_class=DevelopmentConfig):

app.register_blueprint(personal_values_bp)

from app.documentation import bp as documentation_bp

app.register_blueprint(documentation_bp)

from app.post_code import bp as post_code_bp

app.register_blueprint(post_code_bp)
Expand Down
5 changes: 1 addition & 4 deletions app/account/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from flask_jwt_extended import jwt_required
from sqlalchemy.exc import SQLAlchemyError

from app import auto, db, limiter
from app import db, limiter
from app.account import bp
from app.account.schemas import (
UserChangePasswordSchema,
Expand All @@ -30,7 +30,6 @@
@bp.route("/quizId", methods=["GET"])
@cross_origin()
@jwt_required()
@auto.doc()
def current_quizId():
"""
Returns the current quizId of a logged in user or standard JWT errors if token not available or expired.
Expand All @@ -44,7 +43,6 @@ def current_quizId():
@bp.route("/email", methods=["GET"])
@cross_origin()
@jwt_required()
@auto.doc()
def current_email():
"""
Returns the current email address of a logged in user or standard JWT errors if token not available or expired.
Expand All @@ -58,7 +56,6 @@ def current_email():
@bp.route("/email", methods=["PUT"])
@cross_origin()
@jwt_required()
@auto.doc()
def update_email():
"""
# FIXME: move to /user-account PUT
Expand Down
9 changes: 0 additions & 9 deletions app/alignment/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from flask_cors import cross_origin
from flask import jsonify

from app import auto
from app.alignment import bp
from app.common.uuid import validate_uuid, uuidType, check_uuid_in_db
from app.user_b.analytics_logging import log_user_b_event, eventType
Expand All @@ -16,7 +15,6 @@

@bp.route("/alignment", methods=["POST"])
@cross_origin()
@auto.doc()
def post_alignment_uuid():
"""
Post alignment. After user b has taken the quiz, their results are compared to user a and their
Expand Down Expand Up @@ -104,7 +102,6 @@ def get_alignment(alignment_scores_uuid):

@bp.route("/alignment/<alignment_scores_uuid>/shared-impacts", methods=["GET"])
@cross_origin()
@auto.doc()
def get_shared_impacts(alignment_scores_uuid):
"""
Get a list of the shared impacts generated by comparing user A's and user B's quiz scores.
Expand Down Expand Up @@ -140,7 +137,6 @@ def get_shared_impacts(alignment_scores_uuid):

@bp.route("/alignment/<alignment_scores_uuid>/shared-solutions", methods=["GET"])
@cross_origin()
@auto.doc()
def get_shared_solutions(alignment_scores_uuid):
"""
Get a list of the shared solutions generated by comparing user A's and user B's quiz scores.
Expand Down Expand Up @@ -177,7 +173,6 @@ def get_shared_solutions(alignment_scores_uuid):

@bp.route("/alignment/<alignment_scores_uuid>/shared-impacts", methods=["POST"])
@cross_origin()
@auto.doc()
def post_shared_impact_selection(alignment_scores_uuid):
"""
Records the shared impact that user b has selected to discuss with user a.
Expand Down Expand Up @@ -227,7 +222,6 @@ def post_shared_impact_selection(alignment_scores_uuid):

@bp.route("/alignment/<alignment_scores_uuid>/shared-solutions", methods=["POST"])
@cross_origin()
@auto.doc()
def post_shared_solution_selection(alignment_scores_uuid):
"""
Records the shared solutions that user b has selected to discuss with user a.
Expand Down Expand Up @@ -276,7 +270,6 @@ def post_shared_solution_selection(alignment_scores_uuid):

@bp.route("/alignment/shared-impact/<impact_iri>", methods=["GET"])
@cross_origin()
@auto.doc()
def get_shared_impact_details(impact_iri):
"""
Gets the details for a shared impact when the user clicks Learn More on the card in their feed.
Expand All @@ -300,7 +293,6 @@ def get_shared_impact_details(impact_iri):

@bp.route("/alignment/shared-solution/<solution_iri>", methods=["GET"])
@cross_origin()
@auto.doc()
def get_shared_solution_details(solution_iri):
"""
Gets the details for a shared solution when the user clicks Learn More on the card in their feed.
Expand All @@ -324,7 +316,6 @@ def get_shared_solution_details(solution_iri):

@bp.route("/alignment/<alignment_scores_uuid>/summary", methods=["GET"])
@cross_origin()
@auto.doc()
def get_alignment_summary(alignment_scores_uuid):
"""
Gets the alignment summary for user B to see before confirming their consent to share with user A.
Expand Down
3 changes: 1 addition & 2 deletions app/auth/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from app.models import Users
from app.sendgrid.utils import send_welcome_email

from app import db, auto
from app import db
from app import limiter

import uuid
Expand All @@ -46,7 +46,6 @@ def ip_whitelist():


@bp.route("/login", methods=["POST"])
@auto.doc()
@limiter.limit("100/day;50/hour;10/minute;5/second")
def login():
"""
Expand Down
5 changes: 0 additions & 5 deletions app/documentation/__init__.py

This file was deleted.

17 changes: 0 additions & 17 deletions app/documentation/routes.py

This file was deleted.

2 changes: 0 additions & 2 deletions app/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from flask_limiter.util import get_remote_address
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_selfdoc import Autodoc
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import MetaData

Expand All @@ -24,7 +23,6 @@
login.login_view = "auth.login"
login.login_message = "Please log in to access this page."
cache = Cache()
auto = Autodoc()
jwt = JWTManager()
limiter = Limiter(
key_func=get_remote_address, default_limits=["1000 per day", "200 per hour"]
Expand Down
3 changes: 1 addition & 2 deletions app/feed/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
from app.models import Scores
from flask_cors import cross_origin

from app import db, auto, cache
from app import db, cache


@bp.route("/feed", methods=["GET"])
@cross_origin()
@auto.doc()
def get_feed():
"""
The front-end needs to request personalized climate change effects that are most
Expand Down
3 changes: 0 additions & 3 deletions app/myths/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@

MYTH_PROCESSOR = process_myths()

from app import auto


@bp.route("/myths", methods=["GET"])
@cross_origin()
@auto.doc()
def get_general_myths():
"""
The front-end needs a general myths list and information to serve to user when
Expand Down
2 changes: 0 additions & 2 deletions app/personal_values/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from app.personal_values import bp
from app.models import Scores
from app.common.uuid import validate_uuid, uuidType, check_uuid_in_db
from app import auto

from app.personal_values.normalize import normalize_scores
from flask_cors import cross_origin
Expand All @@ -16,7 +15,6 @@

@bp.route("/personal_values", methods=["GET"])
@cross_origin()
@auto.doc()
def get_personal_values():
"""
Users want to know their personal values based on their Schwartz questionnaire
Expand Down
3 changes: 0 additions & 3 deletions app/post_code/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
from app.errors.errors import InvalidUsageError
from flask_cors import cross_origin

from app import auto


@bp.route("/post-code", methods=["POST"])
@cross_origin()
@auto.doc()
def post_code():
"""
Expand Down
2 changes: 0 additions & 2 deletions app/questions/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
from flask import Response
from flask_cors import cross_origin

from app import auto
from app.questions import bp
from app.questions.utils import get_schwartz_questions_file_data


@bp.route("/questions", methods=["GET"])
@cross_origin()
@auto.doc()
def get_questions():
"""
Returns the list of available schwartz personal value questions that can be
Expand Down
3 changes: 0 additions & 3 deletions app/scoring/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
from flask_jwt_extended import jwt_required
from flask_jwt_extended import current_user

from app import auto


@bp.route("/scores", methods=["POST"])
@cross_origin()
@jwt_required(optional=True)
@auto.doc()
def user_scores():
"""
User scores are used to determine which solutions are best to serve
Expand Down
2 changes: 0 additions & 2 deletions app/session/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
from flask_jwt_extended import current_user
from flask_jwt_extended import jwt_required

from app import auto
from app.session import bp
from app.session.session_helpers import get_ip_address, store_session


@bp.route("/session", methods=["POST"])
@cross_origin()
@jwt_required(optional=True)
@auto.doc()
def post_session():
session_uuid = uuid.uuid4()
session_created_timestamp = datetime.datetime.now(timezone.utc)
Expand Down
4 changes: 0 additions & 4 deletions app/solutions/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
import numpy as np
import pickle

from app import auto

SOLUTION_PROCESSOR = process_solutions(4, 0.5)


@bp.route("/get_actions", methods=["GET"])
@cross_origin()
@auto.doc()
def get_actions():
"""
The front-end needs to request actions to take against climate change
Expand All @@ -35,7 +32,6 @@ def get_actions():

@bp.route("/solutions", methods=["GET"])
@cross_origin()
@auto.doc()
def get_general_solutions():
"""
The front-end needs general solutions list and information to serve to user when
Expand Down
3 changes: 0 additions & 3 deletions app/subscribe/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
from flask_cors import cross_origin
from flask import request

from app import auto


@bp.route("/subscribe", methods=["POST"])
@cross_origin()
@auto.doc()
def subscribe():
r = request.get_json(force=True, silent=True)

Expand Down
1 change: 0 additions & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Flask-Login==0.5.0
flask-marshmallow==0.14.0
Flask-Migrate==2.5.3
Flask-SQLAlchemy==2.4.4
Flask-Selfdoc==1.2.3
Flask-Limiter==1.4
limits==1.5.1
future==0.18.2
Expand Down

0 comments on commit 36b8aef

Please sign in to comment.