Skip to content

Commit

Permalink
Hotfix: Invalid XLSX sheet titles
Browse files Browse the repository at this point in the history
  • Loading branch information
lukynmatuska committed Sep 27, 2024
1 parent 1521be4 commit d6f2409
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/services/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
from app.models import Event, TicketStatusEnum
from app.schemas import extra
from openpyxl import Workbook
from openpyxl.workbook.child import INVALID_TITLE_REGEX
from tempfile import NamedTemporaryFile
from io import BytesIO
import sys
import re


def get_event_capacity_summary(event: Event):
Expand Down Expand Up @@ -44,7 +46,8 @@ def get_event_xlsx(event: Event):

for tg in event.ticket_groups:
# Create worksheet for ticket group
ws = wb.create_sheet(title=tg.name)
title = re.sub(INVALID_TITLE_REGEX, '_', tg.name)
ws = wb.create_sheet(title=title)

# Create heading
ws.append([
Expand Down

0 comments on commit d6f2409

Please sign in to comment.