Skip to content

Commit 3c459ae

Browse files
committed
Fix pylint errors
1 parent 3bf181c commit 3c459ae

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

courses/mit_learn_api.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1+
"""MIT Learn APIs"""
12
from urllib.parse import urlencode
3+
from typing import Any, Dict, List
24

5+
from django.utils.dateparse import parse_datetime
36
import requests
4-
import re
5-
from typing import Any, Dict, List, Optional
67

7-
from courses.models import Course, CourseRun
8-
from django.utils.dateparse import parse_datetime
8+
from courses.models import CourseRun
99

1010

1111
class MITLearnAPIError(Exception):
1212
"""Custom exception for MIT Learn API errors."""
13-
pass
13+
1414

1515
LEARN_API_COURSES_LIST_URL = "https://api.learn.mit.edu/api/v1/courses/"
1616

@@ -46,12 +46,6 @@ def fetch_course_from_mit_learn(course_id) -> Dict[str, Any]:
4646
return {}
4747

4848

49-
50-
51-
52-
53-
54-
5549
def sync_mit_learn_courseruns_for_course(course, raw_courseruns: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
5650
"""
5751
Process and normalize raw course data from MIT Learn API, but only for courses that already exist in the database.
@@ -83,4 +77,3 @@ def sync_mit_learn_courseruns_for_course(course, raw_courseruns: List[Dict[str,
8377
num_created += 1
8478
print(f"Created course run: {course_run.edx_course_key} for course {course.title}")
8579
return num_created
86-

0 commit comments

Comments
 (0)