mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 08:22:10 +01:00 
			
		
		
		
	Files are required for solutions and syntheses
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
		
							
								
								
									
										24
									
								
								apps/participation/migrations/0008_auto_20220429_1853.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								apps/participation/migrations/0008_auto_20220429_1853.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					# Generated by Django 3.2.13 on 2022-04-29 16:53
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.db import migrations, models
 | 
				
			||||||
 | 
					import participation.models
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Migration(migrations.Migration):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    dependencies = [
 | 
				
			||||||
 | 
					        ('participation', '0007_remove_passage_place'),
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    operations = [
 | 
				
			||||||
 | 
					        migrations.AlterField(
 | 
				
			||||||
 | 
					            model_name='solution',
 | 
				
			||||||
 | 
					            name='file',
 | 
				
			||||||
 | 
					            field=models.FileField(unique=True, upload_to=participation.models.get_solution_filename, verbose_name='file'),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					        migrations.AlterField(
 | 
				
			||||||
 | 
					            model_name='synthesis',
 | 
				
			||||||
 | 
					            name='file',
 | 
				
			||||||
 | 
					            field=models.FileField(unique=True, upload_to=participation.models.get_synthesis_filename, verbose_name='file'),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
@@ -547,8 +547,6 @@ class Solution(models.Model):
 | 
				
			|||||||
        verbose_name=_("file"),
 | 
					        verbose_name=_("file"),
 | 
				
			||||||
        upload_to=get_solution_filename,
 | 
					        upload_to=get_solution_filename,
 | 
				
			||||||
        unique=True,
 | 
					        unique=True,
 | 
				
			||||||
        blank=True,
 | 
					 | 
				
			||||||
        default="",
 | 
					 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
@@ -588,8 +586,6 @@ class Synthesis(models.Model):
 | 
				
			|||||||
        verbose_name=_("file"),
 | 
					        verbose_name=_("file"),
 | 
				
			||||||
        upload_to=get_synthesis_filename,
 | 
					        upload_to=get_synthesis_filename,
 | 
				
			||||||
        unique=True,
 | 
					        unique=True,
 | 
				
			||||||
        blank=True,
 | 
					 | 
				
			||||||
        default="",
 | 
					 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -751,7 +751,7 @@ class PassageDetailView(LoginRequiredMixin, DetailView):
 | 
				
			|||||||
    def get_context_data(self, **kwargs):
 | 
					    def get_context_data(self, **kwargs):
 | 
				
			||||||
        context = super().get_context_data(**kwargs)
 | 
					        context = super().get_context_data(**kwargs)
 | 
				
			||||||
        if self.request.user.registration in self.object.pool.juries.all():
 | 
					        if self.request.user.registration in self.object.pool.juries.all():
 | 
				
			||||||
            context["my_note"] = Note.objects.get(passage=self.object, jury=self.request.user.registration)
 | 
					            context["my_note"] = Note.objects.get_or_create(passage=self.object, jury=self.request.user.registration)[0]
 | 
				
			||||||
            context["notes"] = NoteTable([note for note in self.object.notes.all() if note])
 | 
					            context["notes"] = NoteTable([note for note in self.object.notes.all() if note])
 | 
				
			||||||
        elif self.request.user.registration.is_admin:
 | 
					        elif self.request.user.registration.is_admin:
 | 
				
			||||||
            context["notes"] = NoteTable([note for note in self.object.notes.all() if note])
 | 
					            context["notes"] = NoteTable([note for note in self.object.notes.all() if note])
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user