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
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")

View file

@ -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' : {