8000 Release v3.0 by jacebrowning · Pull Request #135 · flask-api/flask-api · GitHub
[go: up one dir, main page]

Skip to content

Release v3.0 #135

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

Merged
merged 11 commits into from
Jun 15, 2021
Prev Previous commit
Next Next commit
Default to GET requests
  • Loading branch information
jacebrowning committed Jun 4, 2021
commit c05ad67810b4558348c692cf21e1276e435560c4
2 changes: 1 addition & 1 deletion flask_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from flask_api.app import FlaskAPI

__version__ = '3.0b2'
__version__ = '3.0b3'
4 changes: 2 additions & 2 deletions flask_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ class FlaskAPI(Flask):
response_class = APIResponse

def __init__(self, *args, **kwargs):
super(FlaskAPI, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self.api_settings = APISettings(self.config)
self.register_blueprint(api_resources)
self.jinja_env.filters['urlize_quoted_links'] = urlize_quoted_links

def preprocess_request(self):
request.parser_classes = self.api_settings.DEFAULT_PARSERS
request.renderer_classes = self.api_settings.DEFAULT_RENDERERS
return super(FlaskAPI, self).preprocess_request()
return super().preprocess_request()

def make_response(self, rv):
"""
Expand Down
6 changes: 3 additions & 3 deletions flask_api/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ def _perform_method_overloading(self):
by specifing '_content' and '_content_type' form fields.
"""
try:
self._method = super(APIRequest, self).method
self._method = super().method
except AttributeError:
self._method = ''
self._stream = super(APIRequest, self).stream
self._method = 'GET'
self._stream = super().stream
self._content_type = self.headers.get('Content-Type')
self._content_length = get_content_length(self.environ)

Expand Down
2 changes: 1 addition & 1 deletion flask_api/response.py
B431
Original file line numberDiff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class APIResponse(Response):
api_return_types = (list, dict)

def __init__(self, content=None, *args, **kwargs):
super(APIResponse, self).__init__(None, *args, **kwargs)
super().__init__(None, *args, **kwargs)

media_type = None
if isinstance(content, self.api_return_types) or content == '':
Expand Down
2 changes: 1 addition & 1 deletion flask_api/tests/test_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CustomJsonEncoder(JSONEncoder):
def default(self, o):
if isinstance(o, datetime):
return o.isoformat()
return super(CustomJsonEncoder, self).default(o)
return super().default(o)

app = self._make_app()
app.json_encoder = CustomJsonEncoder
Expand Down
0