Cleaned code
This commit is contained in:
parent
1748639b43
commit
52b962c709
2 changed files with 4 additions and 10 deletions
|
@ -11,10 +11,6 @@ from gestion_sports.payload_builders import (
|
|||
)
|
||||
from models import BookingFilter, Club, User
|
||||
|
||||
DATE_FORMAT = "%d/%m/%Y"
|
||||
|
||||
TIME_FORMAT = "%H:%M"
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
POST_HEADERS = config.get_post_headers("gestion-sports")
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ class GestionSportsLoginPayloadBuilder:
|
|||
def __init__(self):
|
||||
self._user: User | None = None
|
||||
self._club: Club | None = None
|
||||
self._template = LOGIN_TEMPLATE
|
||||
|
||||
def user(self, user: User):
|
||||
self._user = user
|
||||
|
@ -24,8 +23,8 @@ class GestionSportsLoginPayloadBuilder:
|
|||
if self._club is None:
|
||||
raise ArgumentMissing("No club was provided")
|
||||
|
||||
environment = Environment(loader=FileSystemLoader(self._template.parent))
|
||||
template = environment.get_template(self._template.name)
|
||||
environment = Environment(loader=FileSystemLoader(LOGIN_TEMPLATE.parent))
|
||||
template = environment.get_template(LOGIN_TEMPLATE.name)
|
||||
|
||||
return template.render(club=self._club, user=self._user)
|
||||
|
||||
|
@ -34,7 +33,6 @@ class GestionSportsBookingPayloadBuilder:
|
|||
def __init__(self):
|
||||
self._booking_filter: BookingFilter | None = None
|
||||
self._court_id: int | None = None
|
||||
self._template = BOOKING_TEMPLATE
|
||||
|
||||
def booking_filter(self, booking_filter: BookingFilter):
|
||||
self._booking_filter = booking_filter
|
||||
|
@ -50,8 +48,8 @@ class GestionSportsBookingPayloadBuilder:
|
|||
if self.court_id is None:
|
||||
raise ArgumentMissing("No court id was provided")
|
||||
|
||||
environment = Environment(loader=FileSystemLoader(self._template.parent))
|
||||
template = environment.get_template(self._template.name)
|
||||
environment = Environment(loader=FileSystemLoader(BOOKING_TEMPLATE.parent))
|
||||
template = environment.get_template(BOOKING_TEMPLATE.name)
|
||||
|
||||
return template.render(
|
||||
court_id=self._court_id, booking_filter=self._booking_filter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue