Skip to content

Commit

Permalink
[frontend/contest] Fixing constest plugin with new database date format
Browse files Browse the repository at this point in the history
+ course_factory method used on taskset_factory
  • Loading branch information
AlexandreDoneux committed Feb 27, 2024
1 parent f8f8b36 commit e89155c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions inginious/frontend/plugins/contests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def course_menu(course, template_helper):

contest_data = task_dispenser.get_contest_data()
if contest_data['enabled']:
start = datetime.strptime(contest_data['start'], "%Y-%m-%d %H:%M:%S")
end = datetime.strptime(contest_data['end'], "%Y-%m-%d %H:%M:%S")
start = contest_data['start']
end = contest_data['end']
blackout = end - timedelta(hours=contest_data['blackout'])
return template_helper.render("course_menu.html", template_folder="frontend/plugins/contests",
course=course, start=start, end=end, blackout=blackout)
Expand All @@ -96,15 +96,15 @@ class ContestScoreboard(INGIniousAuthPage):
""" Displays the scoreboard of the contest """

def GET_AUTH(self, courseid): # pylint: disable=arguments-differ
course = self.taskset_factory.get_course(courseid)
course = self.course_factory.get_course(courseid)
task_dispenser = course.get_task_dispenser()
if not task_dispenser.get_id() == Contest.get_id():
raise NotFound()
contest_data = task_dispenser.get_contest_data()
if not contest_data['enabled']:
raise NotFound()
start = datetime.strptime(contest_data['start'], "%Y-%m-%d %H:%M:%S")
end = datetime.strptime(contest_data['end'], "%Y-%m-%d %H:%M:%S")
start = contest_data['start']
end = contest_data['end']
blackout = end - timedelta(hours=contest_data['blackout'])

users = self.user_manager.get_course_registered_users(course)
Expand Down

0 comments on commit e89155c

Please sign in to comment.