Skip to content

Commit

Permalink
Rename "finished" CfP state to "finalised"
Browse files Browse the repository at this point in the history
Fixes #1155
  • Loading branch information
russss committed Feb 4, 2024
1 parent 9c1ebef commit cee0eb1
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 23 deletions.
4 changes: 2 additions & 2 deletions apps/base/dev/fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def fake_proposal(fake, reviewers):
"anon-blocked": 0.05,
"new": 0.05,
"reviewed": 0.2,
"finished": 0.3,
"finalised": 0.3,
}

cfp.state = random_state(states)
Expand All @@ -100,7 +100,7 @@ def fake_proposal(fake, reviewers):
if vote.state in ("voted", "stale", "resolved"):
vote.vote = random.randint(0, 2)

if cfp.state == "finished" and type(cfp) is TalkProposal:
if cfp.state == "finalised" and type(cfp) is TalkProposal:
cfp.available_times = "fri_10_13,fri_13_16,fri_16_20,sat_10_13,sat_13_16,sat_16_20,sun_10_13,sun_13_16,sun_16_20"

if type(cfp) in (WorkshopProposal, YouthWorkshopProposal):
Expand Down
6 changes: 3 additions & 3 deletions apps/cfp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,10 @@ class F(FinaliseForm):
proposal.published_participant_equipment = form.participant_equipment.data

proposal.available_times = form.get_availability_json()
proposal.set_state("finished")
proposal.set_state("finalised")

db.session.commit()
app.logger.info("Finished proposal %s", proposal_id)
app.logger.info("Finalised proposal %s", proposal_id)
flash("Thank you for finalising your details!")

return redirect(url_for(".edit_proposal", proposal_id=proposal_id))
Expand All @@ -709,7 +709,7 @@ class F(FinaliseForm):
# Don't overwrite user submitted data
pass

elif proposal.state == "finished":
elif proposal.state == "finalised":
if proposal.published_names:
form.name.data = proposal.published_names
else:
Expand Down
2 changes: 1 addition & 1 deletion apps/schedule/attendee_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def attendee_content():
proposal = PYTHON_CFP_TYPES[form.type.data]()
proposal.user_id = current_user.id
proposal.user_scheduled = True
proposal.state = "finished"
proposal.state = "finalised"
populate(proposal, form)

conflicts = proposal.get_conflicting_content()
Expand Down
2 changes: 1 addition & 1 deletion apps/volunteer/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def run(self):

events = (
Proposal.query.join(Venue, Proposal.scheduled_venue_id == Venue.id)
.filter(Venue.name == venue.name, Proposal.is_accepted)
.filter(Venue.name == venue.name, Proposal.state == "finalised")
.all()
)
for e in events:
Expand Down
8 changes: 4 additions & 4 deletions models/cfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"anon-blocked": ["accepted", "rejected", "withdrawn", "reviewed", "edit"],
"reviewed": ["accepted", "rejected", "withdrawn", "edit", "anonymised"],
"manual-review": ["accepted", "rejected", "withdrawn", "edit"],
"accepted": ["accepted", "rejected", "withdrawn", "finished"],
"finished": ["rejected", "withdrawn", "finished"],
"accepted": ["accepted", "rejected", "withdrawn", "finalised"],
"finalised": ["rejected", "withdrawn", "finalised"],
"withdrawn": ["accepted", "rejected", "withdrawn", "edit"],
}

Expand All @@ -69,7 +69,7 @@
"manual-review",
"reviewed",
"accepted",
"finished",
"finalised",
"withdrawn",
]

Expand Down Expand Up @@ -363,7 +363,7 @@ class Proposal(BaseModel):
state = db.Column(db.String, nullable=False, default="new")
type = db.Column(db.String, nullable=False) # talk, workshop or installation

is_accepted = column_property(state.in_(["accepted", "finished"]))
is_accepted = column_property(state.in_(["accepted", "finalised"]))

# Core information
title = db.Column(db.String, nullable=False)
Expand Down
4 changes: 2 additions & 2 deletions models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def get_export_data(cls):
u.email
for u in User.query.join(
Proposal, Proposal.user_id == User.id
).filter(Proposal.state.in_(("accepted", "finished")))
).filter(Proposal.is_accepted)
],
},
}
Expand Down Expand Up @@ -398,7 +398,7 @@ def get_by_bar_training_token(cls, code) -> User:
@property
def is_cfp_accepted(self):
for proposal in self.proposals:
if proposal.state in {"accepted", "finished"}:
if proposal.is_accepted:
return True
return False

Expand Down
2 changes: 1 addition & 1 deletion templates/cfp/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2>Proposal Detail</h2>
<div class="col-md-6">
<legend>About your {{proposal.human_type}}</legend>
<dl class="dl-vertical">
{% if feature_enabled('CFP_FINALISE') and proposal.state in ['finished'] %}
{% if feature_enabled('CFP_FINALISE') and proposal.state == 'finalised' %}
<dt>Names</dt><dd>{{proposal.published_names}}</dd>
<dt>Pronouns</dt><dd>{{proposal.published_pronouns}}</dd>
<dt>Title</dt><dd>{{proposal.published_title}}</dd>
Expand Down
2 changes: 1 addition & 1 deletion templates/cfp/proposals.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h4><a href="{{ url_for('.edit_proposal', proposal_id=proposal.id) }}">{{ propos
Awaiting the next round
{% elif proposal.state == 'accepted' %}
Accepted, check your <a href="{{ url_for('.proposal_messages', proposal_id=proposal.id) }}">messages</a>
{% elif proposal.state == 'finished' %}
{% elif proposal.state == 'finalised' %}
Accepted and ready
{% elif proposal.state == 'withdrawn' %}
You withdrew this proposal.
Expand Down
18 changes: 10 additions & 8 deletions templates/schedule/_proposal_icons.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{# reusable icons #}
{% macro proposal_icons(prop) %}
{% if not prop.may_record and prop.type == 'talk' and prop.state == 'finished' %}
<span style="padding-left: 10px;" title="This talk will not be recorded"><img src="{{ static_url_for('static', filename='images/icons/not-recorded.svg') }}" width="24" height="24"></span>
{% endif %}
{% if prop.content_note and prop.type == 'talk' and prop.state == 'finished' %}
<span style="padding-left: 10px;" title="There is a content note on this talk">⚠️</span>
{% endif %}
{% if prop.family_friendly and prop.type == 'talk' and prop.state == 'finished' %}
<span style="padding-left: 10px;" title="This talk is family friendly">{{ ["👪", "👩‍👧", "👩‍👦", "👨‍👧", "👨‍👦", "👩‍👩‍👦", "👨‍👨‍👧", "👨‍👨‍👦", "👨‍👩‍👧", "👩‍👩‍👧", "👨‍👦‍👦", "👨‍👧‍👦", "👨‍👧‍👧", "👩‍👧‍👧", "👩‍👦‍👦", "👩‍👧‍👦", "👨‍👩‍👦", "👨‍👨‍👧‍👦", "👨‍👩‍👧‍👧", "👩‍👩‍👧‍👧" ] | random }}</span>
{% if prop.type == 'talk' and prop.state == 'finalised' %}
{% if not prop.may_record %}
<span style="padding-left: 10px;" title="This talk will not be recorded"><img src="{{ static_url_for('static', filename='images/icons/not-recorded.svg') }}" width="24" height="24"></span>
{% endif %}
{% if prop.content_note %}
<span style="padding-left: 10px;" title="There is a content note on this talk">⚠️</span>
{% endif %}
{% if prop.family_friendly %}
<span style="padding-left: 10px;" title="This talk is family friendly">{{ ["👪", "👩‍👧", "👩‍👦", "👨‍👧", "👨‍👦", "👩‍👩‍👦", "👨‍👨‍👧", "👨‍👨‍👦", "👨‍👩‍👧", "👩‍👩‍👧", "👨‍👦‍👦", "👨‍👧‍👦", "👨‍👧‍👧", "👩‍👧‍👧", "👩‍👦‍👦", "👩‍👧‍👦", "👨‍👩‍👦", "👨‍👨‍👧‍👦", "👨‍👩‍👧‍👧", "👩‍👩‍👧‍👧" ] | random }}</span>
{% endif %}
{% endif %}
{% endmacro %}

0 comments on commit cee0eb1

Please sign in to comment.