Skip to content

Commit

Permalink
Merge pull request #1430 from maykinmedia/issue/mijn-taken-filter-on-…
Browse files Browse the repository at this point in the history
…open

Filter taken on status open
  • Loading branch information
alextreme authored Oct 8, 2024
2 parents 663fe21 + e7e91b5 commit 6117076
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/open_inwoner/cms/plugins/models/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ def get_tasks(self):
)
]

def get_tasks_by_bsn(self, bsn):
def get_tasks_by_bsn(self, bsn, status="open"):
tasks = []
for task in self.get_tasks():
identificatie = task["identificatie"]
if not identificatie or identificatie["type"] != "bsn":
continue
task_bsn = identificatie["value"]
if task_bsn and task_bsn == bsn:
if status and task["status"] != status:
continue
tasks += [task]
return tasks
2 changes: 1 addition & 1 deletion src/open_inwoner/templates/cms/plugins/tasks/tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2 class="utrecht-heading-2 {% if userfeed.action_required %}indicator{% endif

<div class="card-container card-container--columns-2 plugin-card">
{% for task in tasks %}
<a href="{{ task.task_url }}" class="card card--status card--status--info {% if task.status != "open" %}card--completed{% endif %}">
<a href="{{ task.task_url }}" target="_blank" class="card card--status card--status--info {% if task.status != "open" %}card--completed{% endif %}">
<div class="userfeed__marker userfeed__marker--info"></div>

<div class="card__body card__body--tabled">
Expand Down

0 comments on commit 6117076

Please sign in to comment.