This commit is contained in:
Aran Zaiger 2015-06-28 17:30:22 +03:00
parent ec1eacb3cd
commit 6452dbd66a
2 changed files with 2 additions and 1 deletions

View file

@ -88,6 +88,7 @@ def create_course(token):
#check if name already exists #check if name already exists
try: try:
query = Course.all() query = Course.all()
query.filter('campusId = ', payload['campusId'])
query.filter("courseName = ", payload['courseName']) query.filter("courseName = ", payload['courseName'])
for c in query.run(limit=1): for c in query.run(limit=1):
return forbidden("Course with same name already exists") return forbidden("Course with same name already exists")

View file

@ -14,7 +14,7 @@ class Course(db.Model):
def to_JSON(self): def to_JSON(self):
data = {'courseName' : self.courseName, data = {'courseName' : self.courseName,
'campusId' : self.campusName, 'campusId' : self.campusId,
'master_id' : self.master_id, 'master_id' : self.master_id,
# 'projects' : self.projects, # 'projects' : self.projects,
'startDate' : { 'startDate' : {