Import macro with context to supply perms

A bug was caused by using the MemberManagementTemplate macro and not supplying all of the necessary
kwargs. Intially, this bug was fixed by supplying the kwargs used by the
macro at the time, but in this refactor, we simply remove those kwargs
and refer to the permissions directly in the template by importing the
macro with context.
This commit is contained in:
graham-dds
2019-10-22 09:32:36 -04:00
parent e39adb9532
commit 0d3aff54c9
3 changed files with 13 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
{% from "components/alert.html" import Alert %}
{% from "components/delete_confirmation.html" import DeleteConfirmation %}
{% from "fragments/environments.html" import EnvironmentManagementTemplate %}
{% from "fragments/members.html" import MemberManagementTemplate %}
{% from "fragments/members.html" import MemberManagementTemplate with context %}
{% from "components/modal.html" import Modal %}
{% from "components/pagination.html" import Pagination %}
{% from "components/save_button.html" import SaveButton %}
@@ -52,11 +52,7 @@
application,
members,
new_member_form,
"applications.create_member",
user_can_create_app_member=user_can(permissions.CREATE_APPLICATION_MEMBER),
user_can_edit_app_member=user_can(permissions.EDIT_APPLICATION_MEMBER),
user_can_delete_app_member=user_can(permissions.DELETE_APPLICATION_MEMBER),
) }}
"applications.create_member") }}
{{ EnvironmentManagementTemplate(
application,