From ca5466709cb2cf817b7a8dfb1d38601c6c3e2ff3 Mon Sep 17 00:00:00 2001 From: Jesse Zong Date: Sun, 24 Mar 2024 03:12:04 -0400 Subject: [PATCH] Relint all with new black version --- backend/dining/migrations/0003_venue_name.py | 4 +- ...move_diningtransaction_profile_and_more.py | 21 +++++++--- backend/gsr_booking/api_wrapper.py | 10 +++-- .../gsr_booking/migrations/0001_initial.py | 18 +++++++-- .../0001_squashed_0011_merge_20200418_2009.py | 39 ++++++++++++++----- .../migrations/0002_auto_20210129_1527.py | 10 ++++- .../migrations/0004_alter_gsr_lid.py | 4 +- .../migrations/0005_usersearchindex.py | 8 +++- .../migrations/0006_auto_20211024_1231.py | 6 ++- .../migrations/0006_gsrbookingcredentials.py | 13 +++++-- .../0007_delete_gsrbookingcredentials.py | 4 +- .../migrations/0008_auto_20211112_1657.py | 13 +++++-- ...emove_groupmembership_username_and_more.py | 5 ++- ...emove_gsrbooking_reminder_sent_and_more.py | 5 ++- .../gsr_booking/migrations/0012_gsr_in_use.py | 4 +- backend/gsr_booking/models.py | 6 ++- backend/gsr_booking/urls.py | 6 ++- backend/gsr_booking/views.py | 4 +- backend/laundry/urls.py | 18 +++++++-- .../0006_fitnesssnapshot_capacity.py | 4 +- .../migrations/0009_auto_20240223_1820.py | 33 ++++++++++++---- .../migrations/0010_auto_20240228_0150.py | 17 ++++++-- ...lter_event_event_type_alter_event_start.py | 4 +- .../migrations/0002_auto_20211003_2225.py | 9 ++++- .../migrations/0005_auto_20211231_1558.py | 28 ++++++++++--- .../migrations/0006_auto_20220112_1529.py | 29 +++++++++++--- .../0009_rename_image_url_post_image.py | 6 ++- .../migrations/0010_remove_post_image.py | 5 ++- .../migrations/0012_remove_post_image.py | 5 ++- .../migrations/0015_auto_20240226_2236.py | 14 +++++-- backend/portal/views.py | 10 ++++- backend/sublet/migrations/0001_initial.py | 4 +- .../migrations/0002_auto_20240209_1649.py | 15 +++++-- backend/tests/laundry/test_models.py | 7 +++- backend/tests/laundry/test_views.py | 4 +- backend/tests/penndata/test_views.py | 23 ++++++++--- backend/tests/user/test_notifs.py | 4 +- .../migrations/0005_auto_20211003_2240.py | 14 +++++-- .../0008_remove_notificationtoken_dev.py | 5 ++- 39 files changed, 341 insertions(+), 97 deletions(-) diff --git a/backend/dining/migrations/0003_venue_name.py b/backend/dining/migrations/0003_venue_name.py index 7a5062bd..40dada7b 100644 --- a/backend/dining/migrations/0003_venue_name.py +++ b/backend/dining/migrations/0003_venue_name.py @@ -11,6 +11,8 @@ class Migration(migrations.Migration): operations = [ migrations.AddField( - model_name="venue", name="name", field=models.CharField(max_length=255, null=True), + model_name="venue", + name="name", + field=models.CharField(max_length=255, null=True), ), ] diff --git a/backend/dining/migrations/0004_remove_diningtransaction_profile_and_more.py b/backend/dining/migrations/0004_remove_diningtransaction_profile_and_more.py index a0f06e8a..a0f90009 100644 --- a/backend/dining/migrations/0004_remove_diningtransaction_profile_and_more.py +++ b/backend/dining/migrations/0004_remove_diningtransaction_profile_and_more.py @@ -10,13 +10,24 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="diningtransaction", name="profile",), + migrations.RemoveField( + model_name="diningtransaction", + name="profile", + ), migrations.AlterField( - model_name="diningitem", name="description", field=models.CharField(max_length=1000), + model_name="diningitem", + name="description", + field=models.CharField(max_length=1000), ), migrations.AlterField( - model_name="diningitem", name="ingredients", field=models.CharField(max_length=1000), + model_name="diningitem", + name="ingredients", + field=models.CharField(max_length=1000), + ), + migrations.DeleteModel( + name="DiningBalance", + ), + migrations.DeleteModel( + name="DiningTransaction", ), - migrations.DeleteModel(name="DiningBalance",), - migrations.DeleteModel(name="DiningTransaction",), ] diff --git a/backend/gsr_booking/api_wrapper.py b/backend/gsr_booking/api_wrapper.py index bf291305..18a18feb 100644 --- a/backend/gsr_booking/api_wrapper.py +++ b/backend/gsr_booking/api_wrapper.py @@ -405,9 +405,11 @@ def book_room(self, gid, rid, room_name, start, end, user, group=None): members = ( [(user, datetime.timedelta(days=99))] if group is None - else self.get_wharton_members(group, gsr.id) - if gsr.kind == GSR.KIND_WHARTON - else self.get_libcal_members(group) + else ( + self.get_wharton_members(group, gsr.id) + if gsr.kind == GSR.KIND_WHARTON + else self.get_libcal_members(group) + ) ) total_time_available = sum( @@ -457,7 +459,7 @@ def cancel_room(self, booking_id, user): gsr_booking := GSRBooking.objects.filter(booking_id=booking_id) .prefetch_related(Prefetch("reservation__gsrbooking_set"), Prefetch("gsr")) .first() - ) : + ): if gsr_booking.user != user and gsr_booking.reservation.creator != user: raise APIError("Error: Unauthorized: This reservation was booked by someone else.") diff --git a/backend/gsr_booking/migrations/0001_initial.py b/backend/gsr_booking/migrations/0001_initial.py index 2002b619..7ff4fead 100644 --- a/backend/gsr_booking/migrations/0001_initial.py +++ b/backend/gsr_booking/migrations/0001_initial.py @@ -18,7 +18,10 @@ class Migration(migrations.Migration): ( "id", models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID", + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), ("name", models.CharField(max_length=255)), @@ -33,15 +36,22 @@ class Migration(migrations.Migration): ( "id", models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID", + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), ("accepted", models.BooleanField(default=False)), - ("type", models.CharField(choices=[("A", "Admin"), ("M", "M")], max_length=10),), + ( + "type", + models.CharField(choices=[("A", "Admin"), ("M", "M")], max_length=10), + ), ( "group", models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="gsr_booking.Group", + on_delete=django.db.models.deletion.CASCADE, + to="gsr_booking.Group", ), ), ( diff --git a/backend/gsr_booking/migrations/0001_squashed_0011_merge_20200418_2009.py b/backend/gsr_booking/migrations/0001_squashed_0011_merge_20200418_2009.py index 98cb99a6..a6f36cba 100644 --- a/backend/gsr_booking/migrations/0001_squashed_0011_merge_20200418_2009.py +++ b/backend/gsr_booking/migrations/0001_squashed_0011_merge_20200418_2009.py @@ -34,7 +34,10 @@ class Migration(migrations.Migration): ( "id", models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID", + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), ("name", models.CharField(max_length=255)), @@ -49,15 +52,22 @@ class Migration(migrations.Migration): ( "id", models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID", + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), ("accepted", models.BooleanField(default=False)), - ("type", models.CharField(choices=[("A", "Admin"), ("M", "M")], max_length=10),), + ( + "type", + models.CharField(choices=[("A", "Admin"), ("M", "M")], max_length=10), + ), ( "group", models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="gsr_booking.Group", + on_delete=django.db.models.deletion.CASCADE, + to="gsr_booking.Group", ), ), ( @@ -104,7 +114,10 @@ class Migration(migrations.Migration): ( "id", models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID", + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), ("full_name", models.CharField(db_index=True, max_length=255)), @@ -112,7 +125,8 @@ class Migration(migrations.Migration): ( "user", models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, ), ), ], @@ -123,7 +137,10 @@ class Migration(migrations.Migration): ( "id", models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID", + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), ( @@ -139,13 +156,17 @@ class Migration(migrations.Migration): ( "email", models.CharField( - max_length=255, null=True, unique=True, verbose_name="school email", + max_length=255, + null=True, + unique=True, + verbose_name="school email", ), ), ( "user", models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, ), ), ( diff --git a/backend/gsr_booking/migrations/0002_auto_20210129_1527.py b/backend/gsr_booking/migrations/0002_auto_20210129_1527.py index 9a665f1d..0411d13d 100644 --- a/backend/gsr_booking/migrations/0002_auto_20210129_1527.py +++ b/backend/gsr_booking/migrations/0002_auto_20210129_1527.py @@ -13,8 +13,14 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="gsrbookingcredentials", name="email",), - migrations.RemoveField(model_name="gsrbookingcredentials", name="id",), + migrations.RemoveField( + model_name="gsrbookingcredentials", + name="email", + ), + migrations.RemoveField( + model_name="gsrbookingcredentials", + name="id", + ), migrations.AlterField( model_name="gsrbookingcredentials", name="date_updated", diff --git a/backend/gsr_booking/migrations/0004_alter_gsr_lid.py b/backend/gsr_booking/migrations/0004_alter_gsr_lid.py index 9d64deac..b9955207 100644 --- a/backend/gsr_booking/migrations/0004_alter_gsr_lid.py +++ b/backend/gsr_booking/migrations/0004_alter_gsr_lid.py @@ -11,6 +11,8 @@ class Migration(migrations.Migration): operations = [ migrations.AlterField( - model_name="gsr", name="lid", field=models.CharField(max_length=255), + model_name="gsr", + name="lid", + field=models.CharField(max_length=255), ), ] diff --git a/backend/gsr_booking/migrations/0005_usersearchindex.py b/backend/gsr_booking/migrations/0005_usersearchindex.py index 80cce7da..61345e3b 100644 --- a/backend/gsr_booking/migrations/0005_usersearchindex.py +++ b/backend/gsr_booking/migrations/0005_usersearchindex.py @@ -19,7 +19,10 @@ class Migration(migrations.Migration): ( "id", models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID", + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), ("full_name", models.CharField(db_index=True, max_length=255)), @@ -27,7 +30,8 @@ class Migration(migrations.Migration): ( "user", models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, ), ), ], diff --git a/backend/gsr_booking/migrations/0006_auto_20211024_1231.py b/backend/gsr_booking/migrations/0006_auto_20211024_1231.py index 004bf153..05297a76 100644 --- a/backend/gsr_booking/migrations/0006_auto_20211024_1231.py +++ b/backend/gsr_booking/migrations/0006_auto_20211024_1231.py @@ -8,7 +8,11 @@ def create_single_user_group(apps, schema_editor): Group = apps.get_model("gsr_booking", "Group") GroupMembership = apps.get_model("gsr_booking", "GroupMembership") for user in User.objects.all(): - group, created = Group.objects.get_or_create(owner=user, name="Me", color="#14f7d1",) + group, created = Group.objects.get_or_create( + owner=user, + name="Me", + color="#14f7d1", + ) if created: GroupMembership.objects.get_or_create(group=group, user=user, type="A", accepted=True) diff --git a/backend/gsr_booking/migrations/0006_gsrbookingcredentials.py b/backend/gsr_booking/migrations/0006_gsrbookingcredentials.py index 8d6366e2..da854a7d 100644 --- a/backend/gsr_booking/migrations/0006_gsrbookingcredentials.py +++ b/backend/gsr_booking/migrations/0006_gsrbookingcredentials.py @@ -19,7 +19,10 @@ class Migration(migrations.Migration): ( "id", models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID", + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", ), ), ( @@ -39,13 +42,17 @@ class Migration(migrations.Migration): ( "email", models.CharField( - max_length=255, null=True, unique=True, verbose_name="school email", + max_length=255, + null=True, + unique=True, + verbose_name="school email", ), ), ( "user", models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, ), ), ], diff --git a/backend/gsr_booking/migrations/0007_delete_gsrbookingcredentials.py b/backend/gsr_booking/migrations/0007_delete_gsrbookingcredentials.py index 4fa32b03..4a089e57 100644 --- a/backend/gsr_booking/migrations/0007_delete_gsrbookingcredentials.py +++ b/backend/gsr_booking/migrations/0007_delete_gsrbookingcredentials.py @@ -10,5 +10,7 @@ class Migration(migrations.Migration): ] operations = [ - migrations.DeleteModel(name="GSRBookingCredentials",), + migrations.DeleteModel( + name="GSRBookingCredentials", + ), ] diff --git a/backend/gsr_booking/migrations/0008_auto_20211112_1657.py b/backend/gsr_booking/migrations/0008_auto_20211112_1657.py index 505d5d6a..bedd8c7d 100644 --- a/backend/gsr_booking/migrations/0008_auto_20211112_1657.py +++ b/backend/gsr_booking/migrations/0008_auto_20211112_1657.py @@ -35,7 +35,10 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="reservation", name="gsr",), + migrations.RemoveField( + model_name="reservation", + name="gsr", + ), migrations.AddField( model_name="gsrbooking", name="reservation", @@ -44,8 +47,12 @@ class Migration(migrations.Migration): ), ), migrations.AddField( - model_name="reservation", name="is_cancelled", field=models.BooleanField(default=False), + model_name="reservation", + name="is_cancelled", + field=models.BooleanField(default=False), + ), + migrations.DeleteModel( + name="UserSearchIndex", ), - migrations.DeleteModel(name="UserSearchIndex",), migrations.RunPython(create_reservation_for_booking), ] diff --git a/backend/gsr_booking/migrations/0009_remove_groupmembership_username_and_more.py b/backend/gsr_booking/migrations/0009_remove_groupmembership_username_and_more.py index c25206a1..9a9e70c0 100644 --- a/backend/gsr_booking/migrations/0009_remove_groupmembership_username_and_more.py +++ b/backend/gsr_booking/migrations/0009_remove_groupmembership_username_and_more.py @@ -10,7 +10,10 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="groupmembership", name="username",), + migrations.RemoveField( + model_name="groupmembership", + name="username", + ), migrations.AddField( model_name="groupmembership", name="is_wharton", diff --git a/backend/gsr_booking/migrations/0010_remove_gsrbooking_reminder_sent_and_more.py b/backend/gsr_booking/migrations/0010_remove_gsrbooking_reminder_sent_and_more.py index 3054dbca..2ef9af6e 100644 --- a/backend/gsr_booking/migrations/0010_remove_gsrbooking_reminder_sent_and_more.py +++ b/backend/gsr_booking/migrations/0010_remove_gsrbooking_reminder_sent_and_more.py @@ -10,7 +10,10 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="gsrbooking", name="reminder_sent",), + migrations.RemoveField( + model_name="gsrbooking", + name="reminder_sent", + ), migrations.AddField( model_name="reservation", name="reminder_sent", diff --git a/backend/gsr_booking/migrations/0012_gsr_in_use.py b/backend/gsr_booking/migrations/0012_gsr_in_use.py index 86b458d0..d1e3879f 100644 --- a/backend/gsr_booking/migrations/0012_gsr_in_use.py +++ b/backend/gsr_booking/migrations/0012_gsr_in_use.py @@ -11,6 +11,8 @@ class Migration(migrations.Migration): operations = [ migrations.AddField( - model_name="gsr", name="in_use", field=models.BooleanField(default=True), + model_name="gsr", + name="in_use", + field=models.BooleanField(default=True), ), ] diff --git a/backend/gsr_booking/models.py b/backend/gsr_booking/models.py index 2a77ad68..41221b81 100644 --- a/backend/gsr_booking/models.py +++ b/backend/gsr_booking/models.py @@ -10,7 +10,11 @@ class GroupMembership(models.Model): # INVARIANT: either user or username should always be set. if user is not None, then the # username should the be username of the associated user. user = models.ForeignKey( - User, on_delete=models.CASCADE, related_name="memberships", blank=True, null=True, + User, + on_delete=models.CASCADE, + related_name="memberships", + blank=True, + null=True, ) group = models.ForeignKey("Group", on_delete=models.CASCADE, related_name="memberships") diff --git a/backend/gsr_booking/urls.py b/backend/gsr_booking/urls.py index 25d35263..460e31e9 100644 --- a/backend/gsr_booking/urls.py +++ b/backend/gsr_booking/urls.py @@ -25,7 +25,11 @@ urlpatterns = [ path("", include(router.urls)), - path("locations/", cache_page(Cache.MONTH)(Locations.as_view()), name="locations",), + path( + "locations/", + cache_page(Cache.MONTH)(Locations.as_view()), + name="locations", + ), path("recent/", RecentGSRs.as_view(), name="recent-gsrs"), path("wharton/", CheckWharton.as_view(), name="is-wharton"), path("availability//", Availability.as_view(), name="availability"), diff --git a/backend/gsr_booking/views.py b/backend/gsr_booking/views.py index a0c3b2c5..b0b7303c 100644 --- a/backend/gsr_booking/views.py +++ b/backend/gsr_booking/views.py @@ -69,7 +69,9 @@ def invites(self, request, username=None): return Response( GroupMembershipSerializer( GroupMembership.objects.filter( - user=user, accepted=False, group__in=self.request.user.booking_groups.all(), + user=user, + accepted=False, + group__in=self.request.user.booking_groups.all(), ), many=True, ).data diff --git a/backend/laundry/urls.py b/backend/laundry/urls.py index df46b41b..b47356e7 100644 --- a/backend/laundry/urls.py +++ b/backend/laundry/urls.py @@ -6,14 +6,26 @@ urlpatterns = [ - path("hall//", cache_page(Cache.MINUTE)(HallInfo.as_view()), name="hall-info",), - path("usage//", cache_page(Cache.MINUTE)(HallUsage.as_view()), name="hall-usage",), + path( + "hall//", + cache_page(Cache.MINUTE)(HallInfo.as_view()), + name="hall-info", + ), + path( + "usage//", + cache_page(Cache.MINUTE)(HallUsage.as_view()), + name="hall-usage", + ), path( "rooms/", cache_page(Cache.MINUTE)(MultipleHallInfo.as_view()), name="multiple-hall-info", ), - path("halls/ids/", cache_page(Cache.MONTH)(Ids.as_view()), name="hall-ids",), + path( + "halls/ids/", + cache_page(Cache.MONTH)(Ids.as_view()), + name="hall-ids", + ), path("status/", Status.as_view(), name="status"), path("preferences/", Preferences.as_view(), name="preferences"), ] diff --git a/backend/penndata/migrations/0006_fitnesssnapshot_capacity.py b/backend/penndata/migrations/0006_fitnesssnapshot_capacity.py index 9d23e748..fa144d61 100644 --- a/backend/penndata/migrations/0006_fitnesssnapshot_capacity.py +++ b/backend/penndata/migrations/0006_fitnesssnapshot_capacity.py @@ -11,6 +11,8 @@ class Migration(migrations.Migration): operations = [ migrations.AddField( - model_name="fitnesssnapshot", name="capacity", field=models.FloatField(null=True), + model_name="fitnesssnapshot", + name="capacity", + field=models.FloatField(null=True), ), ] diff --git a/backend/penndata/migrations/0009_auto_20240223_1820.py b/backend/penndata/migrations/0009_auto_20240223_1820.py index c2259fe5..c615f12f 100644 --- a/backend/penndata/migrations/0009_auto_20240223_1820.py +++ b/backend/penndata/migrations/0009_auto_20240223_1820.py @@ -10,17 +10,34 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RenameField(model_name="event", old_name="start_time", new_name="start",), - migrations.RemoveField(model_name="event", name="end_time",), - migrations.AddField(model_name="event", name="end", field=models.DateTimeField(null=True),), + migrations.RenameField( + model_name="event", + old_name="start_time", + new_name="start", + ), + migrations.RemoveField( + model_name="event", + name="end_time", + ), migrations.AddField( - model_name="event", name="location", field=models.CharField(max_length=255, null=True), + model_name="event", + name="end", + field=models.DateTimeField(null=True), + ), + migrations.AddField( + model_name="event", + name="location", + field=models.CharField(max_length=255, null=True), ), migrations.AlterField( - model_name="event", name="description", field=models.TextField(null=True), + model_name="event", + name="description", + field=models.TextField(null=True), ), migrations.AlterField( - model_name="event", name="email", field=models.CharField(max_length=255, null=True), + model_name="event", + name="email", + field=models.CharField(max_length=255, null=True), ), migrations.AlterField( model_name="event", @@ -28,6 +45,8 @@ class Migration(migrations.Migration): field=models.CharField(max_length=255, null=True), ), migrations.AlterField( - model_name="event", name="image_url", field=models.URLField(null=True), + model_name="event", + name="image_url", + field=models.URLField(null=True), ), ] diff --git a/backend/penndata/migrations/0010_auto_20240228_0150.py b/backend/penndata/migrations/0010_auto_20240228_0150.py index f63fbe6d..9e756298 100644 --- a/backend/penndata/migrations/0010_auto_20240228_0150.py +++ b/backend/penndata/migrations/0010_auto_20240228_0150.py @@ -10,9 +10,14 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="event", name="facebook",), + migrations.RemoveField( + model_name="event", + name="facebook", + ), migrations.AlterField( - model_name="event", name="description", field=models.TextField(blank=True, null=True), + model_name="event", + name="description", + field=models.TextField(blank=True, null=True), ), migrations.AlterField( model_name="event", @@ -20,7 +25,9 @@ class Migration(migrations.Migration): field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AlterField( - model_name="event", name="end", field=models.DateTimeField(blank=True, null=True), + model_name="event", + name="end", + field=models.DateTimeField(blank=True, null=True), ), migrations.AlterField( model_name="event", @@ -28,7 +35,9 @@ class Migration(migrations.Migration): field=models.CharField(blank=True, max_length=255, null=True), ), migrations.AlterField( - model_name="event", name="image_url", field=models.URLField(blank=True, null=True), + model_name="event", + name="image_url", + field=models.URLField(blank=True, null=True), ), migrations.AlterField( model_name="event", diff --git a/backend/penndata/migrations/0011_alter_event_event_type_alter_event_start.py b/backend/penndata/migrations/0011_alter_event_event_type_alter_event_start.py index c8347891..e9e00be9 100644 --- a/backend/penndata/migrations/0011_alter_event_event_type_alter_event_start.py +++ b/backend/penndata/migrations/0011_alter_event_event_type_alter_event_start.py @@ -41,6 +41,8 @@ class Migration(migrations.Migration): ), ), migrations.AlterField( - model_name="event", name="start", field=models.DateTimeField(blank=True, null=True), + model_name="event", + name="start", + field=models.DateTimeField(blank=True, null=True), ), ] diff --git a/backend/portal/migrations/0002_auto_20211003_2225.py b/backend/portal/migrations/0002_auto_20211003_2225.py index 7abb802a..06a6a1b6 100644 --- a/backend/portal/migrations/0002_auto_20211003_2225.py +++ b/backend/portal/migrations/0002_auto_20211003_2225.py @@ -11,14 +11,19 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="poll", name="image_url",), + migrations.RemoveField( + model_name="poll", + name="image_url", + ), migrations.AddField( model_name="poll", name="start_date", field=models.DateTimeField(default=django.utils.timezone.now), ), migrations.AddField( - model_name="polloption", name="vote_count", field=models.IntegerField(default=0), + model_name="polloption", + name="vote_count", + field=models.IntegerField(default=0), ), migrations.AddField( model_name="targetpopulation", diff --git a/backend/portal/migrations/0005_auto_20211231_1558.py b/backend/portal/migrations/0005_auto_20211231_1558.py index c632e384..2f35eba8 100644 --- a/backend/portal/migrations/0005_auto_20211231_1558.py +++ b/backend/portal/migrations/0005_auto_20211231_1558.py @@ -12,14 +12,30 @@ class Migration(migrations.Migration): operations = [ migrations.RenameField( - model_name="poll", old_name="user_comment", new_name="club_comment", + model_name="poll", + old_name="user_comment", + new_name="club_comment", + ), + migrations.RemoveField( + model_name="poll", + name="approved", + ), + migrations.RemoveField( + model_name="poll", + name="source", + ), + migrations.RemoveField( + model_name="poll", + name="user", + ), + migrations.RemoveField( + model_name="pollvote", + name="user", ), - migrations.RemoveField(model_name="poll", name="approved",), - migrations.RemoveField(model_name="poll", name="source",), - migrations.RemoveField(model_name="poll", name="user",), - migrations.RemoveField(model_name="pollvote", name="user",), migrations.AddField( - model_name="poll", name="club_code", field=models.CharField(blank=True, max_length=255), + model_name="poll", + name="club_code", + field=models.CharField(blank=True, max_length=255), ), migrations.AddField( model_name="poll", diff --git a/backend/portal/migrations/0006_auto_20220112_1529.py b/backend/portal/migrations/0006_auto_20220112_1529.py index 3d8b9d17..3dc42228 100644 --- a/backend/portal/migrations/0006_auto_20220112_1529.py +++ b/backend/portal/migrations/0006_auto_20220112_1529.py @@ -11,13 +11,30 @@ class Migration(migrations.Migration): operations = [ migrations.RenameField( - model_name="post", old_name="user_comment", new_name="club_comment", + model_name="post", + old_name="user_comment", + new_name="club_comment", + ), + migrations.RenameField( + model_name="post", + old_name="created_at", + new_name="created_date", + ), + migrations.RemoveField( + model_name="post", + name="approved", + ), + migrations.RemoveField( + model_name="post", + name="source", + ), + migrations.RemoveField( + model_name="post", + name="user", ), - migrations.RenameField(model_name="post", old_name="created_at", new_name="created_date",), - migrations.RemoveField(model_name="post", name="approved",), - migrations.RemoveField(model_name="post", name="source",), - migrations.RemoveField(model_name="post", name="user",), migrations.AddField( - model_name="post", name="club_code", field=models.CharField(blank=True, max_length=255), + model_name="post", + name="club_code", + field=models.CharField(blank=True, max_length=255), ), ] diff --git a/backend/portal/migrations/0009_rename_image_url_post_image.py b/backend/portal/migrations/0009_rename_image_url_post_image.py index b2c04972..64028b4f 100644 --- a/backend/portal/migrations/0009_rename_image_url_post_image.py +++ b/backend/portal/migrations/0009_rename_image_url_post_image.py @@ -10,5 +10,9 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RenameField(model_name="post", old_name="image_url", new_name="image",), + migrations.RenameField( + model_name="post", + old_name="image_url", + new_name="image", + ), ] diff --git a/backend/portal/migrations/0010_remove_post_image.py b/backend/portal/migrations/0010_remove_post_image.py index 7ece1478..ede76232 100644 --- a/backend/portal/migrations/0010_remove_post_image.py +++ b/backend/portal/migrations/0010_remove_post_image.py @@ -10,5 +10,8 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="post", name="image",), + migrations.RemoveField( + model_name="post", + name="image", + ), ] diff --git a/backend/portal/migrations/0012_remove_post_image.py b/backend/portal/migrations/0012_remove_post_image.py index e951895f..2ae2a531 100644 --- a/backend/portal/migrations/0012_remove_post_image.py +++ b/backend/portal/migrations/0012_remove_post_image.py @@ -10,5 +10,8 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="post", name="image",), + migrations.RemoveField( + model_name="post", + name="image", + ), ] diff --git a/backend/portal/migrations/0015_auto_20240226_2236.py b/backend/portal/migrations/0015_auto_20240226_2236.py index 08df76fa..7a9c7108 100644 --- a/backend/portal/migrations/0015_auto_20240226_2236.py +++ b/backend/portal/migrations/0015_auto_20240226_2236.py @@ -11,10 +11,18 @@ class Migration(migrations.Migration): operations = [ migrations.AddField( - model_name="poll", name="priority", field=models.IntegerField(default=0), + model_name="poll", + name="priority", + field=models.IntegerField(default=0), ), migrations.AddField( - model_name="post", name="priority", field=models.IntegerField(default=0), + model_name="post", + name="priority", + field=models.IntegerField(default=0), + ), + migrations.AlterField( + model_name="poll", + name="expire_date", + field=models.DateTimeField(), ), - migrations.AlterField(model_name="poll", name="expire_date", field=models.DateTimeField(),), ] diff --git a/backend/portal/views.py b/backend/portal/views.py index 42e3cff1..595aa5bd 100644 --- a/backend/portal/views.py +++ b/backend/portal/views.py @@ -158,7 +158,10 @@ def browse(self, request): def review(self, request): """Returns list of all Polls that admins still need to approve of""" return Response( - RetrievePollSerializer(Poll.objects.filter(status=Poll.STATUS_DRAFT), many=True,).data + RetrievePollSerializer( + Poll.objects.filter(status=Poll.STATUS_DRAFT), + many=True, + ).data ) @action(detail=True, methods=["get"]) @@ -316,5 +319,8 @@ def browse(self, request): def review(self, request): """Returns a list of all Posts that admins still need to approve of""" return Response( - PostSerializer(Post.objects.filter(status=Poll.STATUS_DRAFT), many=True,).data + PostSerializer( + Post.objects.filter(status=Poll.STATUS_DRAFT), + many=True, + ).data ) diff --git a/backend/sublet/migrations/0001_initial.py b/backend/sublet/migrations/0001_initial.py index 43426833..5245debc 100644 --- a/backend/sublet/migrations/0001_initial.py +++ b/backend/sublet/migrations/0001_initial.py @@ -17,7 +17,9 @@ class Migration(migrations.Migration): operations = [ migrations.CreateModel( name="Amenity", - fields=[("name", models.CharField(max_length=255, primary_key=True, serialize=False)),], + fields=[ + ("name", models.CharField(max_length=255, primary_key=True, serialize=False)), + ], ), migrations.CreateModel( name="Offer", diff --git a/backend/sublet/migrations/0002_auto_20240209_1649.py b/backend/sublet/migrations/0002_auto_20240209_1649.py index 8b31233d..35943aab 100644 --- a/backend/sublet/migrations/0002_auto_20240209_1649.py +++ b/backend/sublet/migrations/0002_auto_20240209_1649.py @@ -10,9 +10,18 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RenameField(model_name="sublet", old_name="max_price", new_name="price",), - migrations.RemoveField(model_name="sublet", name="min_price",), + migrations.RenameField( + model_name="sublet", + old_name="max_price", + new_name="price", + ), + migrations.RemoveField( + model_name="sublet", + name="min_price", + ), migrations.AddField( - model_name="sublet", name="negotiable", field=models.BooleanField(default=True), + model_name="sublet", + name="negotiable", + field=models.BooleanField(default=True), ), ] diff --git a/backend/tests/laundry/test_models.py b/backend/tests/laundry/test_models.py index 4b177e27..519c1d35 100644 --- a/backend/tests/laundry/test_models.py +++ b/backend/tests/laundry/test_models.py @@ -20,7 +20,9 @@ def setUp(self): ) self.laundry_room = LaundryRoom.objects.get(hall_id=0, name="Bishop White", location="Quad") self.snapshot = LaundrySnapshot.objects.create( - room=self.laundry_room, available_washers=10, available_dryers=10, + room=self.laundry_room, + available_washers=10, + available_dryers=10, ) def test_str(self): @@ -49,5 +51,6 @@ def setUp(self): def test_str(self): self.assertEqual( - str(self.room), f"Hall No. {self.room.hall_id} | {self.room.name}", + str(self.room), + f"Hall No. {self.room.hall_id} | {self.room.name}", ) diff --git a/backend/tests/laundry/test_views.py b/backend/tests/laundry/test_views.py index 7a08dfdf..06486afa 100644 --- a/backend/tests/laundry/test_views.py +++ b/backend/tests/laundry/test_views.py @@ -133,7 +133,9 @@ def setUp(self): ) self.laundry_room = LaundryRoom.objects.get(hall_id=0, name="Bishop White", location="Quad") self.snapshot = LaundrySnapshot.objects.create( - room=self.laundry_room, available_washers=5, available_dryers=10, + room=self.laundry_room, + available_washers=5, + available_dryers=10, ) self.client = APIClient() diff --git a/backend/tests/penndata/test_views.py b/backend/tests/penndata/test_views.py index 60b0bf83..474b97bb 100644 --- a/backend/tests/penndata/test_views.py +++ b/backend/tests/penndata/test_views.py @@ -152,10 +152,14 @@ def setUp(self): # create old snapshot and new snapshot FitnessSnapshot.objects.create( - room=self.fitness_room, date=old_time, count=old_count, + room=self.fitness_room, + date=old_time, + count=old_count, ) FitnessSnapshot.objects.create( - room=self.fitness_room, date=self.new_time, count=self.new_count, + room=self.fitness_room, + date=self.new_time, + count=self.new_count, ) def test_get_recent(self): @@ -224,7 +228,10 @@ class TestFitnessUsage(TestCase): def load_snapshots_1(self, date): # 6:00, 0 FitnessSnapshot.objects.create( - room=self.room, date=date + datetime.timedelta(hours=6), count=0, capacity=0.0, + room=self.room, + date=date + datetime.timedelta(hours=6), + count=0, + capacity=0.0, ) # 7:30, 10 FitnessSnapshot.objects.create( @@ -235,7 +242,10 @@ def load_snapshots_1(self, date): ) # 8:00, 65 FitnessSnapshot.objects.create( - room=self.room, date=date + datetime.timedelta(hours=8), count=65, capacity=65.0, + room=self.room, + date=date + datetime.timedelta(hours=8), + count=65, + capacity=65.0, ) # 8:30, 0 FitnessSnapshot.objects.create( @@ -246,7 +256,10 @@ def load_snapshots_1(self, date): ) # 10:00, 60 FitnessSnapshot.objects.create( - room=self.room, date=date + datetime.timedelta(hours=10), count=60, capacity=60.0, + room=self.room, + date=date + datetime.timedelta(hours=10), + count=60, + capacity=60.0, ) # 20:00, 0 FitnessSnapshot.objects.create( diff --git a/backend/tests/user/test_notifs.py b/backend/tests/user/test_notifs.py index 410e7e19..9493dcd7 100644 --- a/backend/tests/user/test_notifs.py +++ b/backend/tests/user/test_notifs.py @@ -290,7 +290,9 @@ def test_batch_notif(self): "service": "PENN_MOBILE", } response = self.client.post( - "/user/notifications/alerts/", json.dumps(payload), content_type="application/json", + "/user/notifications/alerts/", + json.dumps(payload), + content_type="application/json", ) res_json = json.loads(response.content) self.assertEqual(1, len(res_json["success_users"])) diff --git a/backend/user/migrations/0005_auto_20211003_2240.py b/backend/user/migrations/0005_auto_20211003_2240.py index 830f10de..f9e011a7 100644 --- a/backend/user/migrations/0005_auto_20211003_2240.py +++ b/backend/user/migrations/0005_auto_20211003_2240.py @@ -10,7 +10,15 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="profile", name="degrees",), - migrations.RemoveField(model_name="profile", name="expected_graduation",), - migrations.DeleteModel(name="Degree",), + migrations.RemoveField( + model_name="profile", + name="degrees", + ), + migrations.RemoveField( + model_name="profile", + name="expected_graduation", + ), + migrations.DeleteModel( + name="Degree", + ), ] diff --git a/backend/user/migrations/0008_remove_notificationtoken_dev.py b/backend/user/migrations/0008_remove_notificationtoken_dev.py index c622fefb..693cce30 100644 --- a/backend/user/migrations/0008_remove_notificationtoken_dev.py +++ b/backend/user/migrations/0008_remove_notificationtoken_dev.py @@ -10,5 +10,8 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="notificationtoken", name="dev",), + migrations.RemoveField( + model_name="notificationtoken", + name="dev", + ), ]