mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-10-30 23:39:54 +01:00 
			
		
		
		
	Merge branch 'faster_ci' of https://gitlab.crans.org/bde/nk20 into faster_ci
This commit is contained in:
		| @@ -223,7 +223,8 @@ class Transaction(PolymorphicModel): | ||||
|         # Check that the amounts stay between big integer bounds | ||||
|         diff_source, diff_dest = self.validate() | ||||
|  | ||||
|         if not self.source.is_active or not self.destination.is_active: | ||||
|         if not (hasattr(self, '_force_save') and self._force_save) \ | ||||
|                 and (not self.source.is_active or not self.destination.is_active): | ||||
|             raise ValidationError(_("The transaction can't be saved since the source note " | ||||
|                                     "or the destination note is not active.")) | ||||
|  | ||||
| @@ -271,7 +272,7 @@ class RecurrentTransaction(Transaction): | ||||
|     ) | ||||
|  | ||||
|     def clean(self): | ||||
|         if self.template.destination != self.destination: | ||||
|         if self.template.destination != self.destination and not (hasattr(self, '_force_save') and self._force_save): | ||||
|             raise ValidationError( | ||||
|                 _("The destination of this transaction must equal to the destination of the template.")) | ||||
|         return super().clean() | ||||
|   | ||||
| @@ -43,4 +43,5 @@ def delete_transaction(instance, **_kwargs): | ||||
|     """ | ||||
|     if not hasattr(instance, "_no_signal"): | ||||
|         instance.valid = False | ||||
|         instance._force_save = True | ||||
|         instance.save() | ||||
|   | ||||
 Submodule apps/scripts updated: dbe7bf6591...8ec7d68a16
									
								
							| @@ -381,6 +381,11 @@ class SogeCredit(models.Model): | ||||
|             tr.valid = True | ||||
|             tr.created_at = timezone.now() | ||||
|             tr.save() | ||||
|         if self.credit_transaction: | ||||
|             # If the soge credit is deleted while the user is not validated yet, | ||||
|             # there is not credit transaction. | ||||
|             # There is a credit transaction iff the user declares that no bank account | ||||
|             # was opened after the validation of the account. | ||||
|             self.credit_transaction.valid = False | ||||
|             self.credit_transaction.reason += " (invalide)" | ||||
|             self.credit_transaction.save() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user