fix payment
This commit is contained in:
1 parent
4f7486152c
commit
bb3ddd1610
47 files changed
+2137
-51
No files matched your search
@@ -8,6 +8,29 @@ from . import validators
|
||||
from .models import BankInstitution, CompanyBankAccount, PaymentNotice
|
||||
|
||||
|
||||
class ReceiptAlertConfigurationForm(forms.ModelForm):
|
||||
clear_bale_token = forms.BooleanField(label='پاک کردن توکن ذخیرهشده', required=False)
|
||||
|
||||
class Meta:
|
||||
from .models import PaymentReceiptAlertConfiguration
|
||||
model = PaymentReceiptAlertConfiguration
|
||||
fields = '__all__'
|
||||
widgets = {'bale_token': forms.PasswordInput(render_value=False)}
|
||||
help_texts = {'bale_token': 'برای حفظ توکن فعلی این فیلد را خالی بگذارید؛ برای جایگزینی، توکن تازه وارد کنید.'}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.initial['bale_token'] = ''
|
||||
|
||||
def clean(self):
|
||||
data = super().clean()
|
||||
if data.get('clear_bale_token'):
|
||||
data['bale_token'] = ''
|
||||
elif not data.get('bale_token') and self.instance.pk:
|
||||
data['bale_token'] = self.instance.bale_token
|
||||
return data
|
||||
|
||||
|
||||
class BankAccountForm(forms.ModelForm):
|
||||
revision_token = forms.CharField(required=False, widget=forms.HiddenInput)
|
||||
|
||||
|
||||
Reference in new issue
Block a user