From f5dab36f5bd40ecebe19af6bac2caebed581afc3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:36:20 +0000 Subject: [PATCH 1/2] Bump black from 19.10b0 to 24.3.0 in /backend Bumps [black](https://github.com/psf/black) from 19.10b0 to 24.3.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/commits/24.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- backend/Pipfile | 2 +- backend/Pipfile.lock | 46 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/backend/Pipfile b/backend/Pipfile index 37d46dd3..870d0b46 100644 --- a/backend/Pipfile +++ b/backend/Pipfile @@ -4,7 +4,7 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] -black = "==19.10b0" +black = "==24.3.0" unittest-xml-reporting = "*" flake8 = "==6.1.0" flake8-isort = "==6.1.0" diff --git a/backend/Pipfile.lock b/backend/Pipfile.lock index 255d8290..bfa70905 100644 --- a/backend/Pipfile.lock +++ b/backend/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "00fcc1f1633885e1bfb66d00ecfde1bcd4398813869828461c35ed3b4706487b" + "sha256": "f43cf5535834bfdb7af128485cba05172368a4e8ca51e711cba8a3d4f68fc013" }, "pipfile-spec": 6, "requires": { @@ -1035,19 +1035,38 @@ }, "black": { "hashes": [ - "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b", - "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539" + "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f", + "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93", + "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11", + "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0", + "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9", + "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5", + "sha256:65b76c275e4c1c5ce6e9870911384bff5ca31ab63d19c76811cb1fb162678213", + "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d", + "sha256:6905238a754ceb7788a73f02b45637d820b2f5478b20fec82ea865e4f5d4d9f7", + "sha256:79dcf34b33e38ed1b17434693763301d7ccbd1c5860674a8f871bd15139e7837", + "sha256:7bb041dca0d784697af4646d3b62ba4a6b028276ae878e53f6b4f74ddd6db99f", + "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395", + "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995", + "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f", + "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597", + "sha256:b5991d523eee14756f3c8d5df5231550ae8993e2286b8014e2fdea7156ed0959", + "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5", + "sha256:c45f8dff244b3c431b36e3224b6be4a127c6aca780853574c00faf99258041eb", + "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4", + "sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7", + "sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd", + "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7" ], "index": "pypi", - "markers": "python_version >= '3.6'", - "version": "==19.10b0" + "markers": "python_version >= '3.8'", + "version": "==24.3.0" }, "click": { "hashes": [ "sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1", "sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb" ], - "index": "pypi", "markers": "python_version >= '3.6'", "version": "==8.0.4" }, @@ -1269,13 +1288,21 @@ "markers": "python_version >= '3.6'", "version": "==0.7.0" }, + "mypy-extensions": { + "hashes": [ + "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", + "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.0" + }, "packaging": { "hashes": [ - "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", - "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7" + "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", + "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9" ], "markers": "python_version >= '3.7'", - "version": "==23.2" + "version": "==24.0" }, "pathspec": { "hashes": [ @@ -1290,6 +1317,7 @@ "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068", "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768" ], + "markers": "python_version >= '3.8'", "version": "==4.2.0" }, "pluggy": { From ca5466709cb2cf817b7a8dfb1d38601c6c3e2ff3 Mon Sep 17 00:00:00 2001 From: Jesse Zong Date: Sun, 24 Mar 2024 03:12:04 -0400 Subject: [PATCH 2/2] 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", + ), ]