diff --git a/src/app/templates/project.html b/src/app/templates/project.html index 914c441..51843f4 100644 --- a/src/app/templates/project.html +++ b/src/app/templates/project.html @@ -32,7 +32,8 @@ $def with (nav, project, tasks, permissions)
- + $if task[6] == "waiting for delivery": + $if permissions[2]: diff --git a/src/app/views/project.py b/src/app/views/project.py index e162631..d607340 100644 --- a/src/app/views/project.py +++ b/src/app/views/project.py @@ -45,9 +45,11 @@ class Project: fileitem = data['myfile'] permissions = models.project.get_user_permissions(str(session.userid), data.projectid) + tasks = models.project.get_tasks_by_project_id(data.projectid) + print(data.deliver) # Test if the file was uploaded - if fileitem.filename: + if fileitem.filename and tasks[int(data.taskid) == "waiting for delivery"]: if not permissions[1]: print("Permission denied") raise web.seeother(('/project?projectid=' + data.projectid))