Skip to content

Commit

Permalink
Merge pull request #494 from maykinmedia/feature/1162-remove-goal-fro…
Browse files Browse the repository at this point in the history
…m-actions

[#1162] Removed 'goal' field from Action and ActionTemplate
  • Loading branch information
alextreme authored Feb 27, 2023
2 parents 088f99b + ff4e8aa commit dd8ecd8
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 31 deletions.
1 change: 0 additions & 1 deletion src/open_inwoner/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ class Meta:
"end_date",
"is_for",
"file",
"goal",
)

def __init__(self, user, plan=None, *args, **kwargs):
Expand Down
17 changes: 17 additions & 0 deletions src/open_inwoner/accounts/migrations/0054_remove_action_goal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.15 on 2023-02-22 15:27

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("accounts", "0053_user_display_name"),
]

operations = [
migrations.RemoveField(
model_name="action",
name="goal",
),
]
7 changes: 0 additions & 7 deletions src/open_inwoner/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,6 @@ class Action(models.Model):
blank=True,
help_text=_("The description of the action"),
)
goal = models.CharField(
verbose_name=_("Goal"),
default="",
blank=True,
max_length=250,
help_text=_("The goal of the action"),
)
status = models.CharField(
verbose_name=_("Status"),
default=StatusChoices.open,
Expand Down
1 change: 0 additions & 1 deletion src/open_inwoner/accounts/tests/test_actions_expire.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def test_notify_about_expiring_action(self):
)
self.assertEqual(sent_mail.to, [user.email])
self.assertIn(action.name, html_body)
self.assertIn(action.goal, html_body)
self.assertIn(reverse("accounts:action_list"), html_body)

def test_action_does_not_expire_yet(self):
Expand Down
2 changes: 0 additions & 2 deletions src/open_inwoner/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,13 +762,11 @@
<table>
<tr>
<td>Action name</td>
<td>Goal</td>
<td>End date</td>
</tr>
{% for action in actions %}
<tr>
<td>{{ action.name }}</td>
<td>{{ action.goal }}</td>
<td>{{ action.end_date|date:"d-m-Y" }}</td>
</tr>
{% endfor %}
Expand Down
1 change: 0 additions & 1 deletion src/open_inwoner/plans/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def save(self, user, commit=True):
Action.objects.create(
name=action_template.name,
description=action_template.description,
goal=action_template.goal,
type=action_template.type,
end_date=end_date.date(),
is_for=user,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.15 on 2023-02-22 15:27

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("plans", "0011_remove_plan_contacts"),
]

operations = [
migrations.RemoveField(
model_name="actiontemplate",
name="goal",
),
]
9 changes: 0 additions & 9 deletions src/open_inwoner/plans/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ class ActionTemplate(models.Model):
"The description that will be applied to the action if this template in chosen."
),
)
goal = models.CharField(
verbose_name=_("goal"),
default="",
blank=True,
max_length=250,
help_text=_(
"The goal that will be applied to the action if this template in chosen."
),
)
type = models.CharField(
verbose_name=_("Type"),
default=TypeChoices.incidental,
Expand Down
3 changes: 0 additions & 3 deletions src/open_inwoner/plans/templates/plans/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
<div class='preview__title'>{% trans 'Description:' %}</div>
<div>{{ action_template.description }}</div>
<div></div>
<div class='preview__title'>{% trans 'Goal:' %}</div>
<div>{{ action_template.goal }}</div>
<div></div>
<div class='preview__title'>{% trans 'Type:' %}</div>
<div>{{ action_template.get_type_display }}</div>
<div></div>
Expand Down
1 change: 0 additions & 1 deletion src/open_inwoner/plans/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@ class Meta:
plan_template = factory.SubFactory(PlanTemplateFactory)
name = factory.Faker("word")
description = factory.Faker("word")
goal = factory.Faker("paragraph")
end_in_days = factory.Faker("pyint")
6 changes: 1 addition & 5 deletions src/open_inwoner/templates/export/profile/action_export.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ <h1 class="h1">{% trans "Action" %} {{ object }}</h1>
<th class="table__header">{% trans "File" %}</th>
<td class="table__item">{% if object.file %}{% link href=download_url text=object.file.name download=True %}{% endif %}</td>
</tr>
<tr>
<th class="table__header">{% trans "Goal" %}</th>
<td class="table__item">{{ object.goal }}</td>
</tr>
<tr>
<th class="table__header">{% trans "Created on" %}</th>
<td class="table__item">{{ object.created_on }}</td>
Expand All @@ -50,4 +46,4 @@ <h1 class="h1">{% trans "Action" %} {{ object }}</h1>
</tr>
</table>

{% endblock %}
{% endblock %}
1 change: 0 additions & 1 deletion src/open_inwoner/templates/pages/profile/actions/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ <h1 class="h1">
{% input form.is_for no_help=True %}
{% input form.file no_help=True %}
{% endrender_grid %}
{% input form.goal no_help=True %}

{% form_actions primary_text=_("Actie opslaan") %}
{% endrender_form %}
Expand Down

0 comments on commit dd8ecd8

Please sign in to comment.