Skip to content

Commit

Permalink
format and lint python
Browse files Browse the repository at this point in the history
  • Loading branch information
abhigyanghosh30 committed Mar 28, 2024
1 parent fe946e8 commit 04e8bb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
25 changes: 13 additions & 12 deletions webapp/shop/cred/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def cred_sign_up(**_):
return flask.render_template(
"credentials/sign-up.html", sign_up_open=sign_up_open
)

form_fields = {}
for key in flask.request.form:
values = flask.request.form.getlist(key)
Expand Down Expand Up @@ -174,20 +174,20 @@ def cred_sign_up(**_):
)

return (
flask.render_template("credentials/sign-up.html", error="Something went wrong"),
flask.render_template(
"credentials/sign-up.html", error="Something went wrong"
),
400,
)

service_account_info = {
"token_uri": "https://oauth2.googleapis.com/token",
"client_email": os.getenv("GOOGLE_SERVICE_ACCOUNT_EMAIL"),
"private_key": os.getenv(
"GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY"
).replace("\\n", "\n"),
"scopes": [
"https://www.googleapis.com/auth/spreadsheets.readonly"
],
}
"token_uri": "https://oauth2.googleapis.com/token",
"client_email": os.getenv("GOOGLE_SERVICE_ACCOUNT_EMAIL"),
"private_key": os.getenv("GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY").replace(
"\\n", "\n"
),
"scopes": ["https://www.googleapis.com/auth/spreadsheets.readonly"],
}

credentials = service_account.Credentials.from_service_account_info(
service_account_info,
Expand All @@ -214,7 +214,7 @@ def cred_sign_up(**_):
]
},
).execute()

if return_url:
# Personalize thank-you page
flask.session["form_details"] = {
Expand All @@ -228,6 +228,7 @@ def cred_sign_up(**_):
else:
return flask.redirect("/thank-you")


@shop_decorator(area="cred", permission="user", response="html")
def cred_schedule(ua_contracts_api, trueability_api, **_):
error = None
Expand Down
2 changes: 0 additions & 2 deletions webapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
DocParser,
)

from google.oauth2 import service_account
from googleapiclient.discovery import build

# Local
from webapp.login import user_info
Expand Down

0 comments on commit 04e8bb9

Please sign in to comment.