Skip to content

Commit

Permalink
update Course clas in course_responses.py, fix endpoints import issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vlaszdunov committed Aug 11, 2024
1 parent 6695e11 commit 6e3731e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pymoodleclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .client import Client
import endpoints
from . import endpoints
12 changes: 6 additions & 6 deletions pymoodleclient/endpoints/course/course_responses.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from dataclasses import dataclass as dataclass, InitVar
from dataclasses import dataclass as __dataclass, InitVar
from typing import Optional

from pymoodleclient.endpoints.base import ResponseObject


@dataclass
@__dataclass
class CourseFormatOption:
name: str
value: int


@dataclass
class Course(ResponseObject):
@__dataclass
class Course:
id: int
shortname: str
categoryid: int
Expand Down Expand Up @@ -48,12 +48,12 @@ def __post_init__(self):
]


@dataclass
@__dataclass
class CourseList(ResponseObject):
courses: list[Course]

def __post_init__(self):
for course in self.courses:
if "hiddensections" in course.keys():
course.pop("hiddensections")
course = Course(**course)
self.courses[self.courses.index(course)] = Course(**course)

0 comments on commit 6e3731e

Please sign in to comment.