diff --git a/poetry.lock b/poetry.lock index 3c97b229..b1a20fd5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -881,18 +881,19 @@ tool = ["click (>=6.0.0)"] [[package]] name = "gspread" -version = "5.11.0" +version = "6.1.0" description = "Google Spreadsheets Python API" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "gspread-5.11.0-py3-none-any.whl", hash = "sha256:21110370cb5096c6a528806db16ea9329ad1d31203bd529faf7e4a909bb174bc"}, - {file = "gspread-5.11.0.tar.gz", hash = "sha256:16c0a1eab195318ce56e94325be7d71f061ae6923725928dadf777312fd62370"}, + {file = "gspread-6.1.0-py3-none-any.whl", hash = "sha256:67aa3335cfcbb2625e41b53129433ba779f2890244a4c532624362ce5e022342"}, + {file = "gspread-6.1.0.tar.gz", hash = "sha256:576b72b628b251d2ee41e02b982d3c714d511d2a5aa3a88e587ed9efc4d6e752"}, ] [package.dependencies] google-auth = ">=1.12.0" google-auth-oauthlib = ">=0.4.1" +StrEnum = "0.4.15" [[package]] name = "gunicorn" @@ -1969,6 +1970,22 @@ pure-eval = "*" [package.extras] tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] +[[package]] +name = "strenum" +version = "0.4.15" +description = "An Enum that inherits from str." +optional = false +python-versions = "*" +files = [ + {file = "StrEnum-0.4.15-py3-none-any.whl", hash = "sha256:a30cda4af7cc6b5bf52c8055bc4bf4b2b6b14a93b574626da33df53cf7740659"}, + {file = "StrEnum-0.4.15.tar.gz", hash = "sha256:878fb5ab705442070e4dd1929bb5e2249511c0bcf2b0eeacf3bcd80875c82eff"}, +] + +[package.extras] +docs = ["myst-parser[linkify]", "sphinx", "sphinx-rtd-theme"] +release = ["twine"] +test = ["pylint", "pytest", "pytest-black", "pytest-cov", "pytest-pylint"] + [[package]] name = "tomli" version = "2.0.1" diff --git a/ws/utils/member_sheets.py b/ws/utils/member_sheets.py index 0541334d..e89e0060 100644 --- a/ws/utils/member_sheets.py +++ b/ws/utils/member_sheets.py @@ -13,6 +13,7 @@ from collections.abc import Iterable, Iterator from datetime import timedelta from itertools import zip_longest +from pathlib import Path from typing import Any, NamedTuple import gspread @@ -219,7 +220,7 @@ def update_participant( Much more efficient than updating the entire sheet. """ - client = gspread.service_account(settings.OAUTH_JSON_CREDENTIALS) + client = gspread.service_account(Path(settings.OAUTH_JSON_CREDENTIALS)) wks = client.open_by_key(discount.ga_key).sheet1 writer = SheetWriter(discount, trust_cache=False) @@ -250,7 +251,7 @@ def update_discount_sheet(discount: models.Discount, trust_cache: bool) -> None: For individual updates, this approach should be avoided (instead, opting to update individual cells in the spreadsheet). """ - client = gspread.service_account(settings.OAUTH_JSON_CREDENTIALS) + client = gspread.service_account(Path(settings.OAUTH_JSON_CREDENTIALS)) wks: gspread.worksheet.Worksheet = client.open_by_key(discount.ga_key).sheet1 participants = list( discount.participant_set.select_related("membership", "user").order_by("name")