Implement profit sharing system and write tests
This commit is contained in:
@@ -2,8 +2,8 @@ from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from mixins.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
||||
from two_factor.views.mixins import OTPRequiredMixin
|
||||
|
||||
from core.forms import WalletForm
|
||||
from core.models import Wallet
|
||||
from core.forms import OperatorWalletsForm, WalletForm
|
||||
from core.models import OperatorWallets, Wallet
|
||||
|
||||
|
||||
class WalletList(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
@@ -33,3 +33,21 @@ class WalletUpdate(LoginRequiredMixin, OTPRequiredMixin, ObjectUpdate):
|
||||
|
||||
class WalletDelete(LoginRequiredMixin, OTPRequiredMixin, ObjectDelete):
|
||||
model = Wallet
|
||||
|
||||
|
||||
class OperatorWalletsUpdate(LoginRequiredMixin, ObjectUpdate):
|
||||
model = OperatorWallets
|
||||
form_class = OperatorWalletsForm
|
||||
|
||||
page_title = "Update your designated wallets."
|
||||
|
||||
submit_url_name = "operator_wallets_update"
|
||||
submit_url_args = ["type"]
|
||||
|
||||
pk_required = False
|
||||
|
||||
hide_cancel = True
|
||||
|
||||
def get_object(self, **kwargs):
|
||||
wallet, _ = OperatorWallets.objects.get_or_create(user=self.request.user)
|
||||
return wallet
|
||||
|
||||
Reference in New Issue
Block a user