Skip to content

Commit 694dcd1

Browse files
committed
Rename needs_funds_for_travel to need_funds_for_travel
1 parent c854d3d commit 694dcd1

File tree

18 files changed

+64
-40
lines changed

18 files changed

+64
-40
lines changed

backend/api/grants/mutations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class _GrantErrors:
3636
python_usage: list[str] = strawberry.field(default_factory=list)
3737
community_contribution: list[str] = strawberry.field(default_factory=list)
3838
been_to_other_events: list[str] = strawberry.field(default_factory=list)
39-
needs_funds_for_travel: list[str] = strawberry.field(default_factory=list)
39+
need_funds_for_travel: list[str] = strawberry.field(default_factory=list)
4040
need_visa: list[str] = strawberry.field(default_factory=list)
4141
need_accommodation: list[str] = strawberry.field(default_factory=list)
4242
why: list[str] = strawberry.field(default_factory=list)
@@ -110,7 +110,7 @@ class SendGrantInput(BaseGrantInput):
110110
python_usage: str
111111
been_to_other_events: str
112112
community_contribution: str
113-
needs_funds_for_travel: bool
113+
need_funds_for_travel: bool
114114
need_visa: bool
115115
need_accommodation: bool
116116
why: str
@@ -147,7 +147,7 @@ class UpdateGrantInput(BaseGrantInput):
147147
python_usage: str
148148
been_to_other_events: str
149149
community_contribution: str
150-
needs_funds_for_travel: bool
150+
need_funds_for_travel: bool
151151
need_visa: bool
152152
need_accommodation: bool
153153
why: str
@@ -225,7 +225,7 @@ def send_grant(self, info: Info, input: SendGrantInput) -> SendGrantResult:
225225
"python_usage": input.python_usage,
226226
"been_to_other_events": input.been_to_other_events,
227227
"community_contribution": input.community_contribution,
228-
"needs_funds_for_travel": input.needs_funds_for_travel,
228+
"need_funds_for_travel": input.need_funds_for_travel,
229229
"need_visa": input.need_visa,
230230
"need_accommodation": input.need_accommodation,
231231
"why": input.why,

backend/api/grants/tests/test_send_grant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _send_grant(client, conference, conference_code=None, **kwargs):
3131
validationPythonUsage: pythonUsage
3232
validationCommunityContribution: communityContribution
3333
validationBeenToOtherEvents: beenToOtherEvents
34-
validationNeedsFundsForTravel: needsFundsForTravel
34+
validationneedFundsForTravel: needFundsForTravel
3535
validationNeedVisa: needVisa
3636
validationNeedAccommodation: needAccommodation
3737
validationWhy: why
@@ -62,7 +62,7 @@ def _send_grant(client, conference, conference_code=None, **kwargs):
6262
"pythonUsage": grant.python_usage,
6363
"communityContribution": grant.community_contribution,
6464
"beenToOtherEvents": grant.been_to_other_events,
65-
"needsFundsForTravel": grant.needs_funds_for_travel,
65+
"needFundsForTravel": grant.need_funds_for_travel,
6666
"needVisa": grant.need_visa,
6767
"needAccommodation": grant.need_accommodation,
6868
"why": grant.why,

backend/api/grants/tests/test_update_grant.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _update_grant(graphql_client, grant, **kwargs):
2929
validationPythonUsage: pythonUsage
3030
validationCommunityContribution: communityContribution
3131
validationBeenToOtherEvents: beenToOtherEvents
32-
validationNeedsFundsForTravel: needsFundsForTravel
32+
validationneedFundsForTravel: needFundsForTravel
3333
validationNeedVisa: needVisa
3434
validationNeedAccommodation: needAccommodation
3535
validationWhy: why
@@ -60,7 +60,7 @@ def _update_grant(graphql_client, grant, **kwargs):
6060
"pythonUsage": grant.python_usage,
6161
"communityContribution": grant.community_contribution,
6262
"beenToOtherEvents": grant.been_to_other_events,
63-
"needsFundsForTravel": grant.needs_funds_for_travel,
63+
"needFundsForTravel": grant.need_funds_for_travel,
6464
"needVisa": grant.need_visa,
6565
"needAccommodation": grant.need_accommodation,
6666
"why": grant.why,
@@ -104,7 +104,7 @@ def test_update_grant(graphql_client, user):
104104
pythonUsage="random",
105105
communityContribution="Soft toys meetups",
106106
beenToOtherEvents="no",
107-
needsFundsForTravel=True,
107+
needFundsForTravel=True,
108108
needVisa=True,
109109
needAccommodation=True,
110110
why="why not",

backend/api/grants/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Grant:
2828
python_usage: str
2929
community_contribution: str
3030
been_to_other_events: str
31-
needs_funds_for_travel: bool
31+
need_funds_for_travel: bool
3232
need_visa: bool
3333
need_accommodation: bool
3434
why: str
@@ -57,7 +57,7 @@ def from_model(cls, grant: GrantModel) -> Grant:
5757
python_usage=grant.python_usage,
5858
community_contribution=grant.community_contribution,
5959
been_to_other_events=grant.been_to_other_events,
60-
needs_funds_for_travel=grant.needs_funds_for_travel,
60+
need_funds_for_travel=grant.need_funds_for_travel,
6161
need_visa=grant.need_visa,
6262
need_accommodation=grant.need_accommodation,
6363
why=grant.why,

backend/grants/admin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"grant_type",
4040
"python_usage",
4141
"been_to_other_events",
42-
"needs_funds_for_travel",
42+
"need_funds_for_travel",
4343
"why",
4444
"notes",
4545
"travelling_from",
@@ -372,7 +372,7 @@ class Meta:
372372
"grant_type",
373373
"python_usage",
374374
"been_to_other_events",
375-
"needs_funds_for_travel",
375+
"need_funds_for_travel",
376376
"why",
377377
"notes",
378378
"travelling_from",
@@ -445,7 +445,7 @@ class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin):
445445
"country_type",
446446
"occupation",
447447
"approved_type",
448-
"needs_funds_for_travel",
448+
"need_funds_for_travel",
449449
"need_visa",
450450
"need_accommodation",
451451
IsProposedSpeakerFilter,
@@ -511,7 +511,7 @@ class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin):
511511
{
512512
"fields": (
513513
"grant_type",
514-
"needs_funds_for_travel",
514+
"need_funds_for_travel",
515515
"need_visa",
516516
"need_accommodation",
517517
"travelling_from",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 5.1.1 on 2024-11-24 20:46
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('grants', '0021_remove_grant_interested_in_volunteering'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name='grant',
15+
name='needs_funds_for_travel',
16+
),
17+
migrations.AddField(
18+
model_name='grant',
19+
name='need_funds_for_travel',
20+
field=models.BooleanField(default=False, verbose_name='Needs funds for travel'),
21+
),
22+
]

backend/grants/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ class ApprovedType(models.TextChoices):
107107
null=True,
108108
choices=[(country.code, country.name) for country in countries],
109109
)
110-
needs_funds_for_travel = models.BooleanField(_("Needs funds for travel"))
110+
need_funds_for_travel = models.BooleanField(
111+
_("Needs funds for travel"), default=False
112+
)
111113
need_visa = models.BooleanField(_("Need visa/invitation letter?"), default=False)
112114
need_accommodation = models.BooleanField(_("Need accommodation"), default=False)
113115

backend/grants/tests/factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Meta:
2727
python_usage = factory.Faker("text")
2828
been_to_other_events = factory.Faker("text")
2929

30-
needs_funds_for_travel = factory.Faker("boolean")
30+
need_funds_for_travel = factory.Faker("boolean")
3131
why = factory.Faker("text")
3232
notes = factory.Faker("text")
3333
travelling_from = factory.fuzzy.FuzzyChoice([country.code for country in countries])

backend/reviews/templates/grant-review.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ <h2>Grant</h2>
122122

123123
<div class="review-row">
124124
<strong>Needs funds for travel</strong>
125-
<div>{{grant.needs_funds_for_travel|yesno}}</div>
125+
<div>{{grant.need_funds_for_travel|yesno}}</div>
126126
</div>
127127

128128
<div class="review-row">

backend/reviews/templates/grants-recap.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ <h3>
516516
<li>VISA</li>
517517
{% endif %} {% if item.need_accommodation %}
518518
<li>Accommodation</li>
519-
{% endif %} {% if item.needs_funds_for_travel %}
519+
{% endif %} {% if item.need_funds_for_travel %}
520520
<li>Funds for Travel</li>
521-
{% endif %} {% if not item.need_visa and not item.need_accommodation and not item.needs_funds_for_travel %}
521+
{% endif %} {% if not item.need_visa and not item.need_accommodation and not item.need_funds_for_travel %}
522522
<li>Ticket only</li>
523523
{% endif %}
524524
</ul>

0 commit comments

Comments
 (0)