Skip to content
Snippets Groups Projects

Support specific deadline for each category of project.

Merged Andrea Callia D'Iddio requested to merge specific-deadline-for-category into master
2 files
+ 10
11
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 10
9
@@ -131,10 +131,12 @@ def delete_project(project_id):
project.category
).is_deadline_expired_for_staff:
flash(messages.DEADLINE_EXPIRED_FOR_STAFF)
elif (
(project is not None)
and (project.category in category_codes)
and (project.proposer == current_user.username)
elif all(
(
(project is not None),
(project.category in category_codes),
(project.proposer == current_user.username),
)
):
project.deleted = datetime.utcnow()
db.session.commit()
@@ -306,16 +308,15 @@ def update_ranking():
)
deadline_errors = False
for shortlisting in current_shortlist:
current_ranking = shortlisting.staff_ranking
new_ranking = shortlisting_ids.index(shortlisting.id) + 1
if Category.query.get(
Project.query.get(shortlisting.project_id).category
).is_deadline_expired_for_staff:
if (
shortlisting.staff_ranking
!= shortlisting_ids.index(shortlisting.id) + 1
):
if current_ranking != new_ranking:
deadline_errors = True
else:
shortlisting.staff_ranking = shortlisting_ids.index(shortlisting.id) + 1
shortlisting.staff_ranking = new_ranking
if deadline_errors:
flash(messages.DEADLINE_EXPIRED_FOR_STAFF)
return redirect(url_for(f"{current_user.role}.projects"))
Loading