Skip to content

Commit

Permalink
Add payment unit link, update view name
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Oct 12, 2023
1 parent d9d1ec4 commit c1161e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion commcare_connect/opportunity/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def get_object(self):
)
return dict(
completed_modules=CompletedModule.objects.filter(
user=self.request.user, opportunity=opportunity_access.opportunity
user=self.request.user,
opportunity=opportunity_access.opportunity,
),
assessments=Assessment.objects.filter(user=self.request.user, opportunity=opportunity_access.opportunity),
)
Expand Down
4 changes: 2 additions & 2 deletions commcare_connect/opportunity/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
OpportunityUserTableView,
OpportunityUserVisitTableView,
add_budget_existing_users,
add_payment_unit,
download_export,
export_status,
export_user_visits,
export_users_for_payment,
payment_import,
payment_unit_create,
update_visit_status_import,
)

Expand Down Expand Up @@ -47,6 +47,6 @@
path("<int:pk>/payment_table/", view=OpportunityPaymentTableView.as_view(), name="payment_table"),
path("<int:pk>/payment_export/", view=export_users_for_payment, name="payment_export"),
path("<int:pk>/payment_import/", view=payment_import, name="payment_import"),
path("<int:pk>/payment_unit_create/", view=payment_unit_create, name="payment_unit_create"),
path("<int:pk>/add_payment_unit/", view=add_payment_unit, name="add_payment_unit"),
path("<int:pk>/payment_unit_table/", view=OpportunityPaymentUnitTableView.as_view(), name="payment_unit_table"),
]
2 changes: 1 addition & 1 deletion commcare_connect/opportunity/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def payment_import(request, org_slug=None, pk=None):
return redirect("opportunity:detail", org_slug, pk)


def payment_unit_create(request, org_slug=None, pk=None):
def add_payment_unit(request, org_slug=None, pk=None):
opportunity = get_object_or_404(Opportunity, organization=request.org, id=pk)
deliver_units = DeliverUnit.objects.filter(app=opportunity.deliver_app, payment_unit__isnull=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ <h1 class="display-5 mb-0">{{ object.name }}</h1>
Add Budget
</a>
</li>
<li>
<a class="dropdown-item"
href="{% url 'opportunity:add_payment_unit' org_slug=request.org.slug pk=opportunity.id %}">
<i class="bi bi-plus-circle-fill pe-2"></i>
Add Payment Unit
</a>
</li>
<li class="dropdown-divider"></li>
<li>
<a class="dropdown-item" data-bs-toggle="modal" data-bs-target="#exportVisitModal">
Expand Down

0 comments on commit c1161e8

Please sign in to comment.