Fixed error in writing main.lp when the student took no courses

parent 15da003e
......@@ -33,7 +33,7 @@ class CourseNotFoundError(Exception):
msg = "Course {} was not found in the database."
def __init__(self, course):
self.msg = CourseNotFoundError.msg.format(course)
self.msg = CourseNotFoundError.msg.format("'{}'".format(course))
def __str__(self):
return self.msg
......@@ -132,8 +132,9 @@ def gen_main(transcript):
has_taken += '_hasTaken({0},{1}).\n'.format(transcript.name, course)
# strip trailing comma
taken_list = taken_list[:-1]
# strip trailisng comma
if transcript.courses != []:
taken_list = taken_list[:-1]
taken_list += ']).\n'
directory = get_package_dir()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment