Add route and function to update Project details

This commit is contained in:
leigh-mil
2018-10-12 14:15:42 -04:00
parent 562b201eb1
commit bc76ef633e
2 changed files with 33 additions and 0 deletions

View File

@@ -64,3 +64,15 @@ class Projects(object):
raise NotFoundError("projects")
return projects
@classmethod
def update(cls, user, workspace, project, new_data):
if "name" in new_data:
project.name = new_data["name"]
if "description" in new_data:
project.description = new_data["description"]
db.session.add(project)
db.session.commit()
return project