mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 12:32:18 +01:00 
			
		
		
		
	Admins can (in)validate participations
This commit is contained in:
		@@ -234,8 +234,9 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
 | 
			
		||||
        """
 | 
			
		||||
        An admin validates the team (or not)
 | 
			
		||||
        """
 | 
			
		||||
        if not self.object.participation.tournament \
 | 
			
		||||
                or self.request.user.registration not in self.object.participation.tournament.organizers.all():
 | 
			
		||||
        if not self.request.user.user.registration.is_admin and \
 | 
			
		||||
                (not self.object.participation.tournament
 | 
			
		||||
                 or self.request.user.registration not in self.object.participation.tournament.organizers.all()):
 | 
			
		||||
            form.add_error(None, _("You are not an organizer of the tournament."))
 | 
			
		||||
            return self.form_invalid(form)
 | 
			
		||||
        elif self.object.participation.valid is not False:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user