]> prime8.dev >> repos - csc.git/commitdiff
Clear data before adding new data master
authorDamian Myrda <damian@prime8.dev>
Mon, 18 Nov 2024 23:05:51 +0000 (17:05 -0600)
committerDamian Myrda <damian@prime8.dev>
Mon, 18 Nov 2024 23:05:51 +0000 (17:05 -0600)
schoology.py

index 21de793e5da2d3965c7b5b6b9a7151f64d34f5af..1b3df60dc502c63166cf313cd76cb34c411ab12a 100644 (file)
@@ -21,13 +21,13 @@ auth = Auth(
 api = Schoology(auth)
 api.limit = 64
 
 api = Schoology(auth)
 api.limit = 64
 
-group = Group(
-    api.get_group(GROUP_ID).title, api.get_group(GROUP_ID).description
-)
+group = Group(api.get_group(GROUP_ID).title, api.get_group(GROUP_ID).description)
 group.projects = database.read()
 
 
 def get_members():
 group.projects = database.read()
 
 
 def get_members():
+    group.leaders = []
+    group.members = []
     for enrolled in api.get_group_enrollments(GROUP_ID):
         member = Member(enrolled.name_display)
         if enrolled.admin == 1:
     for enrolled in api.get_group_enrollments(GROUP_ID):
         member = Member(enrolled.name_display)
         if enrolled.admin == 1:
@@ -37,6 +37,7 @@ def get_members():
 
 
 def get_updates():
 
 
 def get_updates():
+    group.updates = []
     for update in api.get_group_updates(GROUP_ID):
         user = api.get_user(update.uid)
         member = Member(user.name_display)
     for update in api.get_group_updates(GROUP_ID):
         user = api.get_user(update.uid)
         member = Member(user.name_display)
@@ -45,6 +46,7 @@ def get_updates():
 
 
 def get_events():
 
 
 def get_events():
+    group.events = []
     for event in api.get_group_events(GROUP_ID):
         start = datetime.strptime(event.start, "%Y-%m-%d %H:%M:%S")
         end = None
     for event in api.get_group_events(GROUP_ID):
         start = datetime.strptime(event.start, "%Y-%m-%d %H:%M:%S")
         end = None
@@ -55,6 +57,7 @@ def get_events():
 
 
 def get_discussions():
 
 
 def get_discussions():
+    group.discussions = []
     for discussion in api.get_group_discussions(GROUP_ID):
         group.discussions.append(
             Discussion(discussion.id, discussion.title, discussion.body)
     for discussion in api.get_group_discussions(GROUP_ID):
         group.discussions.append(
             Discussion(discussion.id, discussion.title, discussion.body)