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

fix: Update pnpm version in react lint job #1238

Open
wants to merge 4 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 .github/workflows/pr-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@23.3.0
- uses: psf/black@24.4.2
with:
options: "--check"
src: "."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/react_lint_and_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
node-version: "20.12"

- name: Install pnpm
run: npm install -g pnpm@8.15
run: npm install -g pnpm@9.6.0

- name: Install dependencies
run: cd apps/dashboard && pnpm install
Expand Down
8 changes: 5 additions & 3 deletions accounting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,11 @@ def export_companys(request, year):
e.company.invoice_email_address,
e.company.ths_customer_id,
e.company.invoice_reference,
company_order_total.get(e.company.pk)
if company_order_total.get(e.company.pk)
else None,
(
company_order_total.get(e.company.pk)
if company_order_total.get(e.company.pk)
else None
),
]
)

Expand Down
24 changes: 15 additions & 9 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,19 @@ def exhibitor(request, exhibitor, company):
("purpose", exhibitor.catalogue_purpose),
(
"logo_squared",
(exhibitor.catalogue_logo_squared.url)
if exhibitor.catalogue_logo_squared
else (MISSING_IMAGE if img_placeholder else None),
(
(exhibitor.catalogue_logo_squared.url)
if exhibitor.catalogue_logo_squared
else (MISSING_IMAGE if img_placeholder else None)
),
),
(
"logo_freesize",
(exhibitor.catalogue_logo_freesize.url)
if exhibitor.catalogue_logo_freesize
else (MISSING_IMAGE if img_placeholder else None),
(
(exhibitor.catalogue_logo_freesize.url)
if exhibitor.catalogue_logo_freesize
else (MISSING_IMAGE if img_placeholder else None)
),
),
("contact_name", exhibitor.catalogue_contact_name),
("contact_email_address", exhibitor.catalogue_contact_email_address),
Expand Down Expand Up @@ -115,9 +119,11 @@ def exhibitor(request, exhibitor, company):
),
(
"cities",
exhibitor.catalogue_cities
if exhibitor.catalogue_cities is not None
else "",
(
exhibitor.catalogue_cities
if exhibitor.catalogue_cities is not None
else ""
),
),
(
"benefits",
Expand Down
6 changes: 3 additions & 3 deletions banquet/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ def ticket(participant):
"id": participant.pk,
"seat": participant.seat.name if participant.seat else "",
"table": participant.seat.table.name if participant.seat else "",
"name": participant.user.get_full_name()
if participant.user
else participant.name,
"name": (
participant.user.get_full_name() if participant.user else participant.name
),
"ticket_scanned": participant.ticket_scanned,
}

Expand Down
62 changes: 35 additions & 27 deletions banquet/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,11 @@ def manage_invitations(request, year, banquet_pk):
"pk": invitation.pk,
"group": invitation.group,
"user": invitation.user,
"name": invitation.user.get_full_name()
if invitation.user is not None
else invitation.name,
"name": (
invitation.user.get_full_name()
if invitation.user is not None
else invitation.name
),
"reason": invitation.reason,
"status": invitation.status,
"price": invitation.price,
Expand Down Expand Up @@ -843,9 +845,7 @@ def manage_invitation_form(request, year, banquet_pk, invitation_pk=None):

if invitation is not None and invitation.participant is not None:
form.fields["price"].disabled = True
form.fields[
"price"
].help_text = (
form.fields["price"].help_text = (
"The price cannot be changed as the invitation has already been accepted."
)

Expand Down Expand Up @@ -919,12 +919,16 @@ def manage_participant(request, year, banquet_pk, participant_pk):
"banquet": banquet,
"participant": {
"pk": participant.pk,
"name": participant.user.get_full_name()
if participant.user
else participant.name,
"email_address": participant.user.email
if participant.user
else participant.email_address,
"name": (
participant.user.get_full_name()
if participant.user
else participant.name
),
"email_address": (
participant.user.email
if participant.user
else participant.email_address
),
"phone_number": participant.phone_number,
"dietary_restrictions": participant.dietary_restrictions,
"other_dietary_restrictions": participant.other_dietary_restrictions,
Expand All @@ -948,12 +952,16 @@ def manage_participants(request, year, banquet_pk):
"pk": participant.pk,
"company": participant.company,
"user": participant.user,
"name": participant.user.get_full_name()
if participant.user
else participant.name,
"email_address": participant.user.email
if participant.user
else participant.email_address,
"name": (
participant.user.get_full_name()
if participant.user
else participant.name
),
"email_address": (
participant.user.email
if participant.user
else participant.email_address
),
"alcohol": participant.alcohol,
"seat": participant.seat,
"invitation": participant.invitation_set.first(),
Expand Down Expand Up @@ -1091,9 +1099,9 @@ def invitation(request, year, token):
if invitation.banquet.caption_phone_number is not None:
form.fields["phone_number"].help_text = invitation.banquet.caption_phone_number
if invitation.banquet.caption_dietary_restrictions is not None:
form.fields[
"dietary_restrictions"
].help_text = invitation.banquet.caption_dietary_restrictions
form.fields["dietary_restrictions"].help_text = (
invitation.banquet.caption_dietary_restrictions
)

can_edit = (
invitation.deadline_smart is None
Expand Down Expand Up @@ -1297,9 +1305,9 @@ def external_invitation(request, token):
if invitation.banquet.caption_phone_number is not None:
form.fields["phone_number"].help_text = invitation.banquet.caption_phone_number
if invitation.banquet.caption_dietary_restrictions is not None:
form.fields[
"dietary_restrictions"
].help_text = invitation.banquet.caption_dietary_restrictions
form.fields["dietary_restrictions"].help_text = (
invitation.banquet.caption_dietary_restrictions
)

can_edit = (
invitation.deadline_smart is None
Expand Down Expand Up @@ -1638,9 +1646,9 @@ def export_afterparty(request, year, banquet_pk):
banquet = get_object_or_404(Banquet, pk=banquet_pk)

response = HttpResponse(content_type="text/csv")
response[
"Content-Disposition"
] = 'attachment; filename="afterparty_participants.csv"'
response["Content-Disposition"] = (
'attachment; filename="afterparty_participants.csv"'
)

writer = csv.writer(response, delimiter=",", quoting=csv.QUOTE_ALL)
writer.writerow(["Name", "Email Sent", "Email", "Inviter"])
Expand Down
12 changes: 7 additions & 5 deletions companies/management/commands/importregistrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ def to_int_or_default(value, default_value):
"will_you_send_goods_to_ths_armadas_goods_reception_before_the_fair"
],
),
transport_from_fair_type="armada_transport"
if row["we_would_like_to_use_armada_transport"] == "Yes"
else tuple_value_matching_name(
Exhibitor.transport_from_fair_types,
row["if_no_please_select_one_from_fair"],
transport_from_fair_type=(
"armada_transport"
if row["we_would_like_to_use_armada_transport"] == "Yes"
else tuple_value_matching_name(
Exhibitor.transport_from_fair_types,
row["if_no_please_select_one_from_fair"],
)
),
number_of_packages_from_fair=to_int_or_default(
row["number_of_packages_from_fair"], 0
Expand Down
6 changes: 3 additions & 3 deletions events/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def event(event, request):
"event_end": int(event.date_end.strftime("%s")),
"event_start_string": event.date_start.strftime("%Y-%m-%d %H:%M"),
"registration_end": int(event.date_start.strftime("%s")),
"image_url": request.build_absolute_uri(event.picture.url)
if event.picture
else None,
"image_url": (
request.build_absolute_uri(event.picture.url) if event.picture else None
),
"fee": event.fee_s,
"registration_required": True,
"external_event_link": event.external_event_link,
Expand Down
78 changes: 47 additions & 31 deletions exhibitors/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ def serialize_booths(exhibitor):
{
"id": eib.booth.pk,
"location": {
"parent": {
"id": eib.booth.location.parent.pk,
"name": eib.booth.location.parent.name,
}
if eib.booth.location.parent
else None,
"parent": (
{
"id": eib.booth.location.parent.pk,
"name": eib.booth.location.parent.name,
}
if eib.booth.location.parent
else None
),
"id": eib.booth.location.pk,
"name": eib.booth.location.name,
},
Expand All @@ -51,15 +53,19 @@ def serialize_exhibitor(exhibitor, request):
("purpose", exhibitor.catalogue_purpose),
(
"logo_squared",
(exhibitor.catalogue_logo_squared.url)
if exhibitor.catalogue_logo_squared
else (MISSING_IMAGE if img_placeholder else None),
(
(exhibitor.catalogue_logo_squared.url)
if exhibitor.catalogue_logo_squared
else (MISSING_IMAGE if img_placeholder else None)
),
),
(
"logo_freesize",
(exhibitor.catalogue_logo_freesize.url)
if exhibitor.catalogue_logo_freesize
else (MISSING_IMAGE if img_placeholder else None),
(
(exhibitor.catalogue_logo_freesize.url)
if exhibitor.catalogue_logo_freesize
else (MISSING_IMAGE if img_placeholder else None)
),
),
(
"industries",
Expand Down Expand Up @@ -98,9 +104,11 @@ def serialize_exhibitor(exhibitor, request):
),
(
"cities",
exhibitor.catalogue_cities
if exhibitor.catalogue_cities is not None
else "",
(
exhibitor.catalogue_cities
if exhibitor.catalogue_cities is not None
else ""
),
),
(
"benefits",
Expand Down Expand Up @@ -130,9 +138,11 @@ def serialize_exhibitor(exhibitor, request):
),
(
"location_special",
str(exhibitor.fair_location_special)
if exhibitor.fair_location_special
else "",
(
str(exhibitor.fair_location_special)
if exhibitor.fair_location_special
else ""
),
),
("climate_compensation", exhibitor.climate_compensation),
("flyer", (exhibitor.flyer.url) if exhibitor.flyer else ""),
Expand Down Expand Up @@ -181,9 +191,11 @@ def locations(request):
data.append(
{
"id": location.pk,
"parent": {"id": location.parent.pk, "name": location.parent.name}
if location.parent
else None,
"parent": (
{"id": location.parent.pk, "name": location.parent.name}
if location.parent
else None
),
"name": location.name,
"has_map": bool(location.background),
}
Expand Down Expand Up @@ -223,17 +235,21 @@ def location(request, location_pk):

data = {
"id": location.pk,
"parent": {"id": location.parent.pk, "name": location.parent.name}
if location.parent
else None,
"parent": (
{"id": location.parent.pk, "name": location.parent.name}
if location.parent
else None
),
"name": location.name,
"map": {
"url": location.background.url,
"width": location.background.width,
"height": location.background.height,
}
if location.background
else None,
"map": (
{
"url": location.background.url,
"width": location.background.width,
"height": location.background.height,
}
if location.background
else None
),
"booths": booths,
}

Expand Down
1 change: 0 additions & 1 deletion exhibitors/management/commands/generate_bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
to list options
"""


# Constants, that might change in the future?
# Taken from the example php, you can probably change this if you know what you're doing
static = {
Expand Down
22 changes: 13 additions & 9 deletions exhibitors/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ def exhibitor(request, exhibitor, company):
"company_website": company.website,
"about": exhibitor.catalogue_about,
"purpose": exhibitor.catalogue_purpose,
"logo_squared": exhibitor.catalogue_logo_squared.url
if exhibitor.catalogue_logo_squared
else (MISSING_IMAGE if img_placeholder else None),
"logo_freesize": exhibitor.catalogue_logo_freesize.url
if exhibitor.catalogue_logo_freesize
else (MISSING_IMAGE if img_placeholder else None),
"logo_squared": (
exhibitor.catalogue_logo_squared.url
if exhibitor.catalogue_logo_squared
else (MISSING_IMAGE if img_placeholder else None)
),
"logo_freesize": (
exhibitor.catalogue_logo_freesize.url
if exhibitor.catalogue_logo_freesize
else (MISSING_IMAGE if img_placeholder else None)
),
"contact_name": exhibitor.catalogue_contact_name,
"contact_email_address": exhibitor.catalogue_contact_email_address,
"contact_phone_number": exhibitor.catalogue_contact_phone_number,
Expand All @@ -40,9 +44,9 @@ def exhibitor(request, exhibitor, company):
{"id": competence.pk, "name": competence.competence}
for competence in exhibitor.catalogue_competences.all()
],
"cities": exhibitor.catalogue_cities
if exhibitor.catalogue_cities is not None
else "",
"cities": (
exhibitor.catalogue_cities if exhibitor.catalogue_cities is not None else ""
),
"benefits": [
{"id": benefit.pk, "name": benefit.benefit}
for benefit in exhibitor.catalogue_benefits.all()
Expand Down
Loading
Loading