Replaced self.request.resolver_match.kwargs with self.kwargs in the class-based views in the accounting application.
This commit is contained in:
parent
6fb74a9a8c
commit
be2ffbf79e
@ -805,11 +805,11 @@ class TransactionView(DetailView):
|
|||||||
context_object_name = "txn"
|
context_object_name = "txn"
|
||||||
|
|
||||||
def get_object(self, queryset=None):
|
def get_object(self, queryset=None):
|
||||||
return self.request.resolver_match.kwargs["txn"]
|
return self.kwargs["txn"]
|
||||||
|
|
||||||
def get_template_names(self):
|
def get_template_names(self):
|
||||||
return ["accounting/transaction_detail-%s.html"
|
return ["accounting/transaction_detail-%s.html"
|
||||||
% (self.request.resolver_match.kwargs["txn_type"],)]
|
% (self.kwargs["txn_type"],)]
|
||||||
|
|
||||||
|
|
||||||
@require_GET
|
@require_GET
|
||||||
@ -900,7 +900,7 @@ class TransactionDeleteView(DeleteView):
|
|||||||
"This transaction was deleted successfully.")
|
"This transaction was deleted successfully.")
|
||||||
|
|
||||||
def get_object(self, queryset=None):
|
def get_object(self, queryset=None):
|
||||||
return self.request.resolver_match.kwargs["txn"]
|
return self.kwargs["txn"]
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
return self.request.GET.get("r") or reverse("accounting:home")
|
return self.request.GET.get("r") or reverse("accounting:home")
|
||||||
@ -978,7 +978,7 @@ class AccountListView(ListView):
|
|||||||
class AccountView(DetailView):
|
class AccountView(DetailView):
|
||||||
"""The view of an account."""
|
"""The view of an account."""
|
||||||
def get_object(self, queryset=None):
|
def get_object(self, queryset=None):
|
||||||
return self.request.resolver_match.kwargs["account"]
|
return self.kwargs["account"]
|
||||||
|
|
||||||
|
|
||||||
@method_decorator(login_required, name="dispatch")
|
@method_decorator(login_required, name="dispatch")
|
||||||
|
Loading…
Reference in New Issue
Block a user