From 3ebc903b12d31d69ffd3a52554ee677c002d4df9 Mon Sep 17 00:00:00 2001 From: Didrik Munther Date: Fri, 23 Feb 2024 10:12:03 +0100 Subject: [PATCH] Lint python --- companies/views.py | 6 ++-- .../migrations/0023_add_ir_acceptance_date.py | 32 +++++++++++-------- recruitment/views.py | 18 +++++------ register/migrations/0006_add_signup_log_ip.py | 7 ++-- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/companies/views.py b/companies/views.py index 57e558821..684d62ad3 100644 --- a/companies/views.py +++ b/companies/views.py @@ -1300,9 +1300,9 @@ def contracts_export(request, year): response = HttpResponse(csv, content_type="text/csv; charset=utf-8") response["Content-Length"] = len(csv) - response["Content-Disposition"] = ( - 'attachment; filename="exported signatures.csv"' - ) + response[ + "Content-Disposition" + ] = 'attachment; filename="exported signatures.csv"' return response diff --git a/fair/migrations/0023_add_ir_acceptance_date.py b/fair/migrations/0023_add_ir_acceptance_date.py index b3d4713ce..b596c88a9 100644 --- a/fair/migrations/0023_add_ir_acceptance_date.py +++ b/fair/migrations/0023_add_ir_acceptance_date.py @@ -4,32 +4,38 @@ class Migration(migrations.Migration): - dependencies = [ - ('fair', '0022_auto_20230427_1920'), + ("fair", "0022_auto_20230427_1920"), ] operations = [ migrations.AlterModelOptions( - name='fairday', - options={'default_permissions': [], 'ordering': ['-fair', 'date']}, + name="fairday", + options={"default_permissions": [], "ordering": ["-fair", "date"]}, ), migrations.AlterModelOptions( - name='lunchticket', - options={'default_permissions': [], 'ordering': ['-fair', 'pk'], 'permissions': [('lunchtickets', 'Manage lunch tickets')]}, + name="lunchticket", + options={ + "default_permissions": [], + "ordering": ["-fair", "pk"], + "permissions": [("lunchtickets", "Manage lunch tickets")], + }, ), migrations.AlterModelOptions( - name='organizationgroup', - options={'ordering': ['-fair', 'name']}, + name="organizationgroup", + options={"ordering": ["-fair", "name"]}, ), migrations.AddField( - model_name='fair', - name='registration_acceptance_date', - field=models.DateTimeField(default='2021-01-01 00:00:00+00:00', help_text='The date when the companies will be able to see if they have been accepted or not.'), + model_name="fair", + name="registration_acceptance_date", + field=models.DateTimeField( + default="2021-01-01 00:00:00+00:00", + help_text="The date when the companies will be able to see if they have been accepted or not.", + ), ), migrations.AlterField( - model_name='fair', - name='year', + model_name="fair", + name="year", field=models.IntegerField(default=2024), ), ] diff --git a/recruitment/views.py b/recruitment/views.py index 9eeb42f0d..863d2fd4a 100644 --- a/recruitment/views.py +++ b/recruitment/views.py @@ -1196,9 +1196,9 @@ def recruitment_application_interview( interview_planning_form = InterviewPlanningForm( request.POST or None, instance=application ) - interview_planning_form.fields["recommended_role"].queryset = ( - application.recruitment_period.recruitable_roles - ) + interview_planning_form.fields[ + "recommended_role" + ].queryset = application.recruitment_period.recruitable_roles used_slots = [] @@ -1282,9 +1282,9 @@ def recruitment_application_interview( if "interviewer" in interview_planning_form.fields: interview_planning_form.fields["interviewer"].choices = interviewers_by_language if "interviewer2" in interview_planning_form.fields: - interview_planning_form.fields["interviewer2"].choices = ( - interviewers_by_language - ) + interview_planning_form.fields[ + "interviewer2" + ].choices = interviewers_by_language RoleDelegationForm = modelform_factory( RecruitmentApplication, fields=["delegated_role", "superior_user", "status"] @@ -1293,9 +1293,9 @@ def recruitment_application_interview( role_delegation_form = RoleDelegationForm( request.POST or None, instance=application ) - role_delegation_form.fields["delegated_role"].queryset = ( - application.recruitment_period.recruitable_roles - ) + role_delegation_form.fields[ + "delegated_role" + ].queryset = application.recruitment_period.recruitable_roles role_delegation_form.fields["superior_user"].choices = [("", "---------")] + [ (interviewer.pk, interviewer.get_full_name()) for interviewer in interviewers ] diff --git a/register/migrations/0006_add_signup_log_ip.py b/register/migrations/0006_add_signup_log_ip.py index 180be6cb4..20c55119a 100644 --- a/register/migrations/0006_add_signup_log_ip.py +++ b/register/migrations/0006_add_signup_log_ip.py @@ -4,15 +4,14 @@ class Migration(migrations.Migration): - dependencies = [ - ('register', '0005_auto_20190505_1539'), + ("register", "0005_auto_20190505_1539"), ] operations = [ migrations.AddField( - model_name='signuplog', - name='ip_address', + model_name="signuplog", + name="ip_address", field=models.GenericIPAddressField(blank=True, null=True), ), ]