Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump black from 19.10b0 to 24.3.0 in /backend #273

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
46 changes: 37 additions & 9 deletions backend/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion backend/dining/migrations/0003_venue_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -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",),
]
10 changes: 6 additions & 4 deletions backend/gsr_booking/api_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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.")

Expand Down
18 changes: 14 additions & 4 deletions backend/gsr_booking/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand All @@ -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",
),
),
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand All @@ -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",
),
),
(
Expand Down Expand Up @@ -104,15 +114,19 @@ 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)),
("pennkey", models.CharField(db_index=True, max_length=255)),
(
"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,
),
),
],
Expand All @@ -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",
),
),
(
Expand All @@ -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,
),
),
(
Expand Down
10 changes: 8 additions & 2 deletions backend/gsr_booking/migrations/0002_auto_20210129_1527.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion backend/gsr_booking/migrations/0004_alter_gsr_lid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
]
8 changes: 6 additions & 2 deletions backend/gsr_booking/migrations/0005_usersearchindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ 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)),
("pennkey", models.CharField(db_index=True, max_length=255)),
(
"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,
),
),
],
Expand Down
6 changes: 5 additions & 1 deletion backend/gsr_booking/migrations/0006_auto_20211024_1231.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
13 changes: 10 additions & 3 deletions backend/gsr_booking/migrations/0006_gsrbookingcredentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
),
(
Expand All @@ -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,
),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ class Migration(migrations.Migration):
]

operations = [
migrations.DeleteModel(name="GSRBookingCredentials",),
migrations.DeleteModel(
name="GSRBookingCredentials",
),
]
Loading
Loading