Убрал возможность участникам проекта редактировать информацию о нем
This commit is contained in:
parent
ab82863761
commit
ed88142524
6
main.py
6
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(
|
||||
|
||||
@ -6,6 +6,7 @@ body {
|
||||
min-height: 100%;
|
||||
}
|
||||
.navbar {
|
||||
margin-top: -1.1vw;
|
||||
background-color: #dcb495;
|
||||
display: inline-flex;
|
||||
height: 8vw;
|
||||
|
||||
@ -13,6 +13,9 @@
|
||||
<title>{{title}}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h4 style="text-align:center;">Это деманстрационная версия сайта, пока что мы не рекомендуем сохранять здесь важные данные</h4>
|
||||
</div>
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8"
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<a class="open_button" data-bs-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false"
|
||||
aria-controls="collapseExample">
|
||||
<div class="open_button_text">
|
||||
Редикторовать
|
||||
Редактировать
|
||||
</div>
|
||||
</a>
|
||||
<a class="profile_button" id="logout_button" href="/logout">
|
||||
|
||||
@ -8,9 +8,13 @@
|
||||
</div>
|
||||
<div class="project_header">
|
||||
<div class="edit_block">
|
||||
{% if current_user.id == project.creator %}
|
||||
<a id="edit_button" class="edit_button" href="">
|
||||
<img class="edit_button_image" src="../static/images/pen_b.png">
|
||||
</a>
|
||||
{% else %}
|
||||
<p class="edit_button"> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="brand_block">
|
||||
<img class="project_logo" src="../{{project.photo}}"/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user