Skip to content

Commit

Permalink
fix data
Browse files Browse the repository at this point in the history
  • Loading branch information
Giga77 committed Mar 15, 2024
1 parent b90b304 commit 268fed6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/ecole_directe/ecoleDirecte_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def getResponse(session, url, data):
else:
token = None

if data is None:
data = "{" + "}"

_LOGGER.debug("URL: [%s] - Data: [%s]", url, data)
response = requests.post(url, data=data, headers=getHeaders(token))

Expand Down Expand Up @@ -166,15 +169,15 @@ def getHomeworkByDate(session, eleve, date):
return getResponse(
session,
f"{APIURL}/eleves/{eleve.eleve_id}/cahierdetexte/{date}.awp?verbe=get&v={APIVERSION}",
"data={}",
None,
)


def getHomework(session, eleve):
return getResponse(
session,
f"{APIURL}/eleves/{eleve.eleve_id}/cahierdetexte.awp?verbe=get&v={APIVERSION}",
"data={}",
None,
)


Expand Down

0 comments on commit 268fed6

Please sign in to comment.