diff --git a/main.py b/main.py index d9adbf0..884ae47 100644 --- a/main.py +++ b/main.py @@ -97,11 +97,11 @@ def task_project(id_project, id_task): form = AnswerTask() current_answer = data_session.query(Answer).filter(Answer.quest == current_task.id).first() list_files = None - if form.validate_on_submit(): + if form.submit.data and request.method == 'POST': if form.deadline_date.data and form.deadline_time.data: deadline = datetime.datetime.combine(form.deadline_date.data, form.deadline_time.data) else: - deadline = None + deadline = current_task.deadline current_task.deadline = deadline if current_answer: current_answer.text = form.text.data @@ -201,7 +201,7 @@ def edit_project(id_project): current_project = data_session.query(Projects).filter(Projects.id == id_project).first() if current_project: staff = data_session.query(StaffProjects).filter(StaffProjects.project == current_project.id).all() - if current_user.id == current_project.creator or current_user.id in list(map(lambda x: x.user, staff)): + if current_user.id == current_project.creator: list_users = list( map(lambda x: get_user_data(x), data_session.query(User).filter(User.id != current_user.id).all())) staff = list(map(lambda x: get_user_data(x), data_session.query(User).filter( diff --git a/static/css/base.css b/static/css/base.css index bbce475..ee41eb1 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -6,6 +6,7 @@ body { min-height: 100%; } .navbar { + margin-top: -1.1vw; background-color: #dcb495; display: inline-flex; height: 8vw; diff --git a/templates/base.html b/templates/base.html index 9fcfaac..cab0da0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,58 +1,61 @@ - - - + + + - + {{title}} - - - - {% if current_user.is_authenticated %} - +{% endif %} + +
{% block content %}{% endblock %}
+ - + + + diff --git a/templates/profile.html b/templates/profile.html index a57cbe4..bde308f 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -8,7 +8,7 @@ diff --git a/templates/project.html b/templates/project.html index aef4cdc..1bbe8d3 100644 --- a/templates/project.html +++ b/templates/project.html @@ -8,9 +8,13 @@
+ {% if current_user.id == project.creator %} + {% else %} +

+ {% endif %}