Skip to content

Commit

Permalink
Removed mpc from persons
Browse files Browse the repository at this point in the history
  • Loading branch information
reinout committed Dec 17, 2024
1 parent 5af910e commit 0ebeb5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
6 changes: 0 additions & 6 deletions trs/templates/trs/person.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ <h1>
<td>{{ view.person.group }}</td>
</tr>
{% endif %}
{% if view.person.mpc %}
<tr>
<th>Markt-product-combinatie</th>
<td>{{ view.person.mpc }}</td>
</tr>
{% endif %}
<tr>
<th>Extra rollen</th>
<td>{{ view.extra_roles }}</td>
Expand Down
23 changes: 2 additions & 21 deletions trs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class BaseView(LoginAndPermissionsRequiredMixin, TemplateView, BaseMixin):
class PersonsView(BaseView):

title = "Medewerkers"
normally_visible_filters = ["status", "group", "mpc", "year"]
normally_visible_filters = ["status", "group", "year"]

@cached_property
def results_for_selection_pager(self):
Expand Down Expand Up @@ -402,21 +402,6 @@ def filters_and_choices(self):
]
+ [{"value": "geen", "title": "Zonder groep", "q": Q(group=None)}],
},
{
"title": "MPC",
"param": "mpc",
"default": "all",
"choices": [{"value": "all", "title": "Geen filter", "q": Q()}]
+ [
{
"value": str(mpc.id),
"title": mpc.name,
"q": Q(mpc=mpc.id),
}
for mpc in MPC.objects.all()
]
+ [{"value": "geen", "title": "Zonder MPC", "q": Q(mpc=None)}],
},
{
"title": "Jaar",
"param": "year",
Expand Down Expand Up @@ -1862,7 +1847,7 @@ def form_valid(self, form):
class PersonEditView(LoginAndPermissionsRequiredMixin, UpdateView, BaseMixin):
template_name = "trs/edit.html"
model = Person
fields = ["name", "user", "group", "mpc", "is_management", "archived"]
fields = ["name", "user", "group", "is_management", "archived"]

@cached_property
def person(self):
Expand Down Expand Up @@ -3801,8 +3786,6 @@ def projects(self):
def persons(self):
if self.group:
return Person.objects.filter(group=self.group)
if self.mpc:
return Person.objects.filter(mpc=self.mpc)
return Person.objects.all()

@cached_property
Expand All @@ -3825,8 +3808,6 @@ def _info_from_bookings(self, year):
relevant_persons = Person.objects.filter(id__in=relevant_person_ids)
if self.group:
relevant_persons = relevant_persons.filter(group=self.group)
if self.mpc:
relevant_persons = relevant_persons.filter(mpc=self.mpc)
pycs = [core.get_pyc(person=person, year=year) for person in relevant_persons]
return {
"turnover": sum([pyc.turnover for pyc in pycs]),
Expand Down

0 comments on commit 0ebeb5a

Please sign in to comment.