Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digitalmarketplace-utils dependency: bump to 43.0.0, remove featureflags references, fix error handlers for flask 0.12 #832

Merged
merged 1 commit into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sqlalchemy import MetaData

import dmapiclient
from dmutils import init_app, flask_featureflags
from dmutils import init_app

from config import configs

Expand All @@ -17,7 +17,6 @@
"pk": "%(table_name)s_pkey",
}))
search_api_client = dmapiclient.SearchAPIClient()
feature_flags = flask_featureflags.FeatureFlag()


def create_app(config_name):
Expand All @@ -28,7 +27,6 @@ def create_app(config_name):
application,
configs[config_name],
db=db,
feature_flags=feature_flags,
search_api_client=search_api_client
)

Expand Down
6 changes: 4 additions & 2 deletions app/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from flask import jsonify
from werkzeug.exceptions import default_exceptions

from .main import main
from .callbacks import callbacks
Expand All @@ -25,5 +26,6 @@ def generic_error_handler(e):


for code in range(400, 599):
main.app_errorhandler(code)(generic_error_handler)
callbacks.app_errorhandler(code)(generic_error_handler)
if code in default_exceptions: # flask complains if we attempt to register a handler for status code its unaware of
main.app_errorhandler(code)(generic_error_handler)
callbacks.app_errorhandler(code)(generic_error_handler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just do for code in default_exceptions: and ditch the if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmmmmmmmaybe... as long as we're 100% certain that werkzeug will only ever put 400 -> 599 status codes in there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they do put extra ones in, we should probably handle them 😹

3 changes: 0 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class Config:
DM_LOG_PATH = None
DM_APP_NAME = 'api'

# Feature Flags
RAISE_ERROR_ON_MISSING_FEATURES = True

DM_API_SERVICES_PAGE_SIZE = 100
DM_API_SUPPLIERS_PAGE_SIZE = 100
DM_API_BRIEFS_PAGE_SIZE = 100
Expand Down
6 changes: 2 additions & 4 deletions requirements-app.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Run `make freeze-requirements` to update requirements.txt
# with package version changes made in requirements-app.txt

Flask==0.10.1
Flask==0.12.4
Flask-Bcrypt==0.7.1
Flask-Migrate==2.0.3
Flask-SQLAlchemy==2.1
Expand All @@ -10,9 +10,7 @@ psycopg2==2.7.3
SQLAlchemy==1.1.4
SQLAlchemy-Utils==0.30.5

git+https://github.com/alphagov/[email protected]#egg=Flask-FeatureFlags==1.0

git+https://github.com/alphagov/[email protected]#egg=digitalmarketplace-utils==41.2.1
git+https://github.com/alphagov/[email protected]#egg=digitalmarketplace-utils==43.0.0
git+https://github.com/alphagov/[email protected]#egg=digitalmarketplace-apiclient==19.0.0

# For schema validation
Expand Down
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Run `make freeze-requirements` to update requirements.txt
# with package version changes made in requirements-app.txt

Flask==0.10.1
Flask==0.12.4
Flask-Bcrypt==0.7.1
Flask-Migrate==2.0.3
Flask-SQLAlchemy==2.1
Expand All @@ -11,9 +11,7 @@ psycopg2==2.7.3
SQLAlchemy==1.1.4
SQLAlchemy-Utils==0.30.5

git+https://github.com/alphagov/[email protected]#egg=Flask-FeatureFlags==1.0

git+https://github.com/alphagov/[email protected]#egg=digitalmarketplace-utils==41.2.1
git+https://github.com/alphagov/[email protected]#egg=digitalmarketplace-utils==43.0.0
git+https://github.com/alphagov/[email protected]#egg=digitalmarketplace-apiclient==19.0.0

# For schema validation
Expand All @@ -27,9 +25,10 @@ asn1crypto==0.24.0
bcrypt==3.1.4
boto3==1.4.8
botocore==1.8.50
certifi==2018.4.16
certifi==2018.8.13
cffi==1.11.5
chardet==3.0.4
click==6.7
contextlib2==0.4.0
cryptography==2.3
docopt==0.4.0
Expand Down