Replaced the get_absolute_url() method in the transaction data model with the get_success_url() method in the transaction form model, and added the current application to the arguments to enable multiple instances of the application in the accounting application.
This commit is contained in:
@ -860,6 +860,12 @@ class TransactionFormView(FormView):
|
||||
"""Returns the current object, or None on a create form."""
|
||||
return self.kwargs.get("txn")
|
||||
|
||||
def get_success_url(self) -> str:
|
||||
"""Returns the URL on success."""
|
||||
return reverse("accounting:transactions.detail",
|
||||
args=(self.txn_type, self.get_object()),
|
||||
current_app=self.request.resolver_match.namespace)
|
||||
|
||||
@property
|
||||
def txn_type(self) -> str:
|
||||
"""Returns the transaction type of this form."""
|
||||
|
Reference in New Issue
Block a user