mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	Visual fixes
This commit is contained in:
		@@ -143,7 +143,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
 | 
			
		||||
                        {% endblocktrans %}
 | 
			
		||||
                    </div>
 | 
			
		||||
                {% endif %}
 | 
			
		||||
                <div class="alert {% if registration.user.note.balance < fee %}alert-danger{% else %}alert-success{% endif %}">
 | 
			
		||||
                <div class="alert {% if registration.validation_status == 2 %}alert-danger{% else %}alert-success{% endif %}">
 | 
			
		||||
                    <h5>{% trans "Required payments:" %}</h5>
 | 
			
		||||
                    <ul>
 | 
			
		||||
                        <li>{% blocktrans trimmed with amount=fee|pretty_money %}
 | 
			
		||||
 
 | 
			
		||||
@@ -1125,16 +1125,16 @@ class WEIValidateRegistrationView(ProtectQuerysetMixin, ProtectedCreateView):
 | 
			
		||||
                               'credit': credit_amount,
 | 
			
		||||
                               'needed': total_needed}
 | 
			
		||||
                           )
 | 
			
		||||
            return super().form_invalid(form)
 | 
			
		||||
            return self.form_invalid(form)
 | 
			
		||||
 | 
			
		||||
        if credit_amount:
 | 
			
		||||
            if not last_name:
 | 
			
		||||
                form.add_error('last_name', _("This field is required."))
 | 
			
		||||
                return super().form_invalid(form)
 | 
			
		||||
                return self.form_invalid(form)
 | 
			
		||||
 | 
			
		||||
            if not first_name:
 | 
			
		||||
                form.add_error('first_name', _("This field is required."))
 | 
			
		||||
                return super().form_invalid(form)
 | 
			
		||||
                return self.form_invalid(form)
 | 
			
		||||
 | 
			
		||||
            # Credit note before adding the membership
 | 
			
		||||
            SpecialTransaction.objects.create(
 | 
			
		||||
@@ -1178,6 +1178,13 @@ class WEIValidateRegistrationView(ProtectQuerysetMixin, ProtectedCreateView):
 | 
			
		||||
 | 
			
		||||
        return super().form_valid(form)
 | 
			
		||||
 | 
			
		||||
    def form_invalid(self, form):
 | 
			
		||||
        registration = getattr(form.instance, "registration", None)
 | 
			
		||||
        if registration is not None:
 | 
			
		||||
            registration.deposit_check = False
 | 
			
		||||
            registration.save()
 | 
			
		||||
        return super().form_invalid(form)
 | 
			
		||||
 | 
			
		||||
    def get_success_url(self):
 | 
			
		||||
        self.object.refresh_from_db()
 | 
			
		||||
        return reverse_lazy("wei:wei_registrations", kwargs={"pk": self.object.club.pk})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user