Skip to content

Commit 349d69f

Browse files
authored
Merge pull request #94 from NodeJSmith/fix/api_for_otf_class
Fix/api for otf class
2 parents b837752 + 3fab338 commit 349d69f

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

.bumpversion.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "0.13.1"
2+
current_version = "0.13.2"
33

44
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:-(?P<rc_l>rc)(?P<rc>0|[1-9]\\d*))?"
55

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "otf-api"
3-
version = "0.13.1"
3+
version = "0.13.2"
44
description = "Python OrangeTheory Fitness API Client"
55
authors = [{ name = "Jessica Smith", email = "[email protected]" }]
66
requires-python = ">=3.11"

source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
project = "OrangeTheory API"
1515
copyright = "2025, Jessica Smith"
1616
author = "Jessica Smith"
17-
release = "0.13.1"
17+
release = "0.13.2"
1818

1919
# -- General configuration ---------------------------------------------------
2020
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

src/otf_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _setup_logging() -> None:
3636

3737
_setup_logging()
3838

39-
__version__ = "0.13.1"
39+
__version__ = "0.13.2"
4040

4141

4242
__all__ = ["Otf", "OtfUser", "models"]

src/otf_api/api/bookings/booking_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def get_classes(
188188
for c in classes_resp:
189189
c["studio"] = studio_dict[c["studio"]["id"]] # the one (?) place where ID actually means UUID
190190
c["is_home_studio"] = c["studio"].studio_uuid == self.otf.home_studio_uuid
191-
classes.append(models.OtfClass(**c))
191+
classes.append(models.OtfClass.create(**c, api=self.otf))
192192

193193
# additional data filtering and enrichment
194194

src/otf_api/api/workouts/workout_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def get_workouts(
275275
v2_booking=bookings_dict[perf_id],
276276
telemetry=telemetry_dict.get(perf_id),
277277
class_uuid=perf_summary_to_class_uuid_map.get(perf_id),
278-
api=self,
278+
api=self.otf,
279279
)
280280
workouts.append(workout)
281281

src/otf_api/models/mixins.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ def set_api(self, api: "Otf") -> None:
2222
self._api = api
2323

2424
@classmethod
25-
def create(cls, **kwargs) -> typing.Self:
25+
def create(cls, api: "Otf", **kwargs) -> typing.Self:
2626
"""Creates a new instance of the model with the given keyword arguments."""
27-
api = kwargs.pop("api", None)
2827
instance = cls(**kwargs)
2928
if api is not None:
3029
instance.set_api(api)

0 commit comments

Comments
 (0)