[go: up one dir, main page]

Skip to content

Commit

Permalink
chore: update import statement (#10579)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Aug 31, 2023
1 parent ef240c5 commit 75cdd07
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions cloud-sql/mysql/sqlalchemy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from flask import render_template, Request, Response
import flask

import functions_framework

Expand All @@ -26,7 +26,7 @@


@functions_framework.http
def votes(request: Request) -> Response:
def votes(request: flask.Request) -> flask.Response:
"""Handles HTTP requests to our application.
Args:
Expand All @@ -44,13 +44,13 @@ def votes(request: Request) -> Response:
migrate_db(db)
if request.method == "GET":
context = get_index_context(db)
return render_template("index.html", **context)
return flask.render_template("index.html", **context)

if request.method == "POST":
team = request.form["team"]
return save_vote(db, team)

return Response(
return flask.Response(
response="Invalid http request. Method not allowed, must be 'GET' or 'POST'",
status=400,
)
8 changes: 4 additions & 4 deletions cloud-sql/postgres/sqlalchemy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from flask import render_template, Request, Response
import flask

import functions_framework

Expand All @@ -26,7 +26,7 @@


@functions_framework.http
def votes(request: Request) -> Response:
def votes(request: flask.Request) -> flask.Response:
global db
# initialize db within request context
if not db:
Expand All @@ -36,13 +36,13 @@ def votes(request: Request) -> Response:
migrate_db(db)
if request.method == "GET":
context = get_index_context(db)
return render_template("index.html", **context)
return flask.render_template("index.html", **context)

if request.method == "POST":
team = request.form["team"]
return save_vote(db, team)

return Response(
return flask.Response(
response="Invalid http request. Method not allowed, must be 'GET' or 'POST'",
status=400,
)
8 changes: 4 additions & 4 deletions cloud-sql/sql-server/sqlalchemy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from flask import render_template, Request, Response
import flask

import functions_framework

Expand All @@ -26,7 +26,7 @@


@functions_framework.http
def votes(request: Request) -> Response:
def votes(request: flask.Request) -> flask.Response:
global db
# initialize db within request context
if not db:
Expand All @@ -36,13 +36,13 @@ def votes(request: Request) -> Response:
migrate_db(db)
if request.method == "GET":
context = get_index_context(db)
return render_template("index.html", **context)
return flask.render_template("index.html", **context)

if request.method == "POST":
team = request.form["team"]
return save_vote(db, team)

return Response(
return flask.Response(
response="Invalid http request. Method not allowed, must be 'GET' or 'POST'",
status=400,
)

0 comments on commit 75cdd07

Please sign in to comment.