From 6452dbd66a7d9294a1ec85fbef1f596ffbfe5fed Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Sun, 28 Jun 2015 17:30:22 +0300 Subject: [PATCH] fix #79 --- SE_API/CourseRoutes.py | 1 + models/Course.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SE_API/CourseRoutes.py b/SE_API/CourseRoutes.py index 1585d28..07c9101 100644 --- a/SE_API/CourseRoutes.py +++ b/SE_API/CourseRoutes.py @@ -88,6 +88,7 @@ def create_course(token): #check if name already exists try: query = Course.all() + query.filter('campusId = ', payload['campusId']) query.filter("courseName = ", payload['courseName']) for c in query.run(limit=1): return forbidden("Course with same name already exists") diff --git a/models/Course.py b/models/Course.py index 444ed04..57bb436 100644 --- a/models/Course.py +++ b/models/Course.py @@ -14,7 +14,7 @@ class Course(db.Model): def to_JSON(self): data = {'courseName' : self.courseName, - 'campusId' : self.campusName, + 'campusId' : self.campusId, 'master_id' : self.master_id, # 'projects' : self.projects, 'startDate' : {