diff --git a/backend/clubs/admin.py b/backend/clubs/admin.py index 15fd94b24..65fbb509c 100644 --- a/backend/clubs/admin.py +++ b/backend/clubs/admin.py @@ -407,8 +407,7 @@ class ZoomMeetingVisitAdmin(admin.ModelAdmin): class ApplicationSubmissionAdmin(admin.ModelAdmin): - list_display = ("user", "id", "created_at", "status", "archived") - list_filter = ("archived",) + list_display = ("user", "id", "created_at", "status") admin.site.register(Asset) diff --git a/backend/clubs/migrations/0095_remove_applicationsubmission_archived.py b/backend/clubs/migrations/0095_remove_applicationsubmission_archived.py new file mode 100644 index 000000000..2b957af31 --- /dev/null +++ b/backend/clubs/migrations/0095_remove_applicationsubmission_archived.py @@ -0,0 +1,14 @@ +# Generated by Django 3.2.18 on 2024-02-03 22:21 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("clubs", "0094_applicationcycle_release_date"), + ] + + operations = [ + migrations.RemoveField(model_name="applicationsubmission", name="archived",), + ] diff --git a/backend/clubs/models.py b/backend/clubs/models.py index 3a97df684..6ebbaa943 100644 --- a/backend/clubs/models.py +++ b/backend/clubs/models.py @@ -1730,7 +1730,6 @@ class ApplicationSubmission(models.Model): on_delete=models.SET_NULL, null=True, ) - archived = models.BooleanField(default=False) notified = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) diff --git a/backend/clubs/views.py b/backend/clubs/views.py index 60a8934ca..85ab0d5ed 100644 --- a/backend/clubs/views.py +++ b/backend/clubs/views.py @@ -4445,7 +4445,6 @@ def question_response(self, *args, **kwargs): user=self.request.user, committee__isnull=False, application=application, - archived=False, ) .values_list("committee__name", flat=True) .distinct() @@ -4480,10 +4479,7 @@ def question_response(self, *args, **kwargs): } ) submission, _ = ApplicationSubmission.objects.get_or_create( - user=self.request.user, - application=application, - committee=committee, - archived=False, + user=self.request.user, application=application, committee=committee, ) key = f"applicationsubmissions:{application.id}" @@ -4592,9 +4588,7 @@ def questions(self, *args, **kwargs): response = ( ApplicationQuestionResponse.objects.filter( - question=question, - submission__user=self.request.user, - submission__archived=False, + question=question, submission__user=self.request.user, ) .select_related("submission", "multiple_choice", "question") .prefetch_related("question__committees", "question__multiple_choice") @@ -4707,7 +4701,7 @@ def send_emails(self, *args, **kwargs): # Query for recent submissions with user and committee joined submissions = ApplicationSubmission.objects.filter( - application=app, archived=False, + application=app ).select_related("user", "committee") dry_run = self.request.data.get("dry_run") @@ -5168,9 +5162,7 @@ def get_operation_id(self, **kwargs): def get_queryset(self): return ( - ApplicationSubmission.objects.filter( - application__is_wharton_council=True, archived=False, - ) + ApplicationSubmission.objects.filter(application__is_wharton_council=True) .annotate( annotated_name=F("application__name"), annotated_committee=F("committee__name"), @@ -5212,7 +5204,7 @@ class ApplicationSubmissionViewSet(viewsets.ModelViewSet): def get_queryset(self): app_id = self.kwargs["application_pk"] submissions = ( - ApplicationSubmission.objects.filter(application=app_id, archived=False,) + ApplicationSubmission.objects.filter(application=app_id) .select_related("user__profile", "committee", "application__club") .prefetch_related( Prefetch( @@ -5277,7 +5269,7 @@ def export(self, *args, **kwargs): """ app_id = int(self.kwargs["application_pk"]) data = ( - ApplicationSubmission.objects.filter(application=app_id, archived=False,) + ApplicationSubmission.objects.filter(application=app_id) .select_related("user__profile", "committee", "application__club") .prefetch_related( Prefetch( @@ -5322,7 +5314,6 @@ def exportall(self, *args, **kwargs): ApplicationSubmission.objects.filter( application__is_wharton_council=True, application__application_cycle=cycle, - archived=False, ) .select_related("application", "application__application_cycle") .annotate( @@ -5475,9 +5466,7 @@ class ApplicationSubmissionUserViewSet(viewsets.ModelViewSet): def get_queryset(self): submissions = ( - ApplicationSubmission.objects.filter( - user=self.request.user, archived=False, - ) + ApplicationSubmission.objects.filter(user=self.request.user) .select_related("user__profile", "committee", "application__club") .prefetch_related( Prefetch( @@ -5492,17 +5481,6 @@ def get_queryset(self): ) return submissions - def perform_destroy(self, instance): - """ - Set archived boolean to be True so that the submissions - appears to have been deleted - """ - - instance.archived = True - instance.archived_by = self.request.user - instance.archived_on = timezone.now() - instance.save() - class ApplicationQuestionViewSet(viewsets.ModelViewSet): """ diff --git a/frontend/components/Submissions.tsx b/frontend/components/Submissions.tsx index b78276f64..87b5ade21 100644 --- a/frontend/components/Submissions.tsx +++ b/frontend/components/Submissions.tsx @@ -163,12 +163,18 @@ function SubmissionsPage({