Skip to content

Commit

Permalink
🔧 Refactor user-agent version retrieval in ODPGent class (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas authored Nov 15, 2024
1 parent 5f56c06 commit e5b5c3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/odp_gent/odp_gent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from .exceptions import ODPGentConnectionError, ODPGentError
from .models import BlueBike, Garage, ParkAndRide, Partago

VERSION = metadata.version(__package__)


@dataclass
class ODPGent:
Expand Down Expand Up @@ -52,7 +54,6 @@ async def _request(
ODPGentError: If the data is not valid.
"""
version = metadata.version(__package__)
url = URL.build(
scheme="https",
host="data.stad.gent",
Expand All @@ -61,7 +62,7 @@ async def _request(

headers = {
"Accept": "application/json",
"User-Agent": f"PythonODPGent/{version}",
"User-Agent": f"PythonODPGent/{VERSION}",
}

if self.session is None:
Expand Down

0 comments on commit e5b5c3c

Please sign in to comment.