#6 Created route to enroll student into a course

This commit is contained in:
2023-04-06 18:51:43 -04:00
parent 0b392ab5b1
commit 8ec489beb3
2 changed files with 21 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ class User(UserMixin, db.Model):
def enroll(self, c) -> bool:
if not self.is_enrolled(c):
self.enrolled_courses.append(c)
db.session.commit()
return True
return False