mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 00:52:03 +01:00 
			
		
		
		
	Add payment interface tests
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
		@@ -226,6 +226,9 @@ class PaymentAdminForm(forms.ModelForm):
 | 
			
		||||
    def __init__(self, *args, **kwargs):
 | 
			
		||||
        super().__init__(*args, **kwargs)
 | 
			
		||||
        self.fields["valid"].widget.choices[0] = ('unknown', _("Pending"))
 | 
			
		||||
        payment_type = kwargs.get('data', {}).get('type', "")
 | 
			
		||||
        self.fields['receipt'].required = payment_type in ["scholarship", "bank_transfer"]
 | 
			
		||||
        self.fields['additional_information'].required = payment_type in ["other"]
 | 
			
		||||
 | 
			
		||||
    def clean_receipt(self):
 | 
			
		||||
        if "receipt" in self.files:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user