Skip to content

Commit 189568e

Browse files
authored
Merge branch 'enext' into upload-avatar-fix
2 parents 607f961 + 4c92d7e commit 189568e

File tree

89 files changed

+1438
-942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1438
-942
lines changed

app/eventyay/agenda/views/talk.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,13 @@ def check_user_owning_ticket(user: User, event: Event) -> TicketCheckResult:
360360
# NOTE: It doesn't work with the Docker setup for development, because we use fake domain then,
361361
and inside the container, the fake domain points to the container itself, not the host.
362362
"""
363-
if 'ticket_link' not in event.display_settings:
364-
logger.info('display_settings[ticket_link] is missing.')
365-
return TicketCheckResult.MISCONFIGURED
366-
base_url, organizer_slug, event_slug = extract_event_info_from_url(
367-
event.display_settings['ticket_link']
368-
)
369-
if not organizer_slug or not event_slug or not base_url:
370-
logger.info('display_settings[ticket_link] is not valid.')
371-
return TicketCheckResult.MISCONFIGURED
363+
# Use unified ticket base path and event slugs; no manual URL needed
364+
base_url = settings.EVENTYAY_TICKET_BASE_PATH
365+
# Normalize base URL to keep urljoin from dropping path segments
366+
if not base_url.endswith('/'):
367+
base_url = f'{base_url}/'
368+
organizer_slug = event.organizer.slug
369+
event_slug = event.slug
372370
check_payload = {'user_email': user.email}
373371
# call to ticket to check if user order ticket yet or not
374372
api_url = urljoin(base_url, f'api/v1/{organizer_slug}/{event_slug}/ticket-check')

app/eventyay/api/webhooks.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -175,51 +175,51 @@ def build_payload(self, logentry: LogEntry):
175175
def register_default_webhook_events(sender, **kwargs):
176176
return (
177177
ParametrizedOrderWebhookEvent(
178-
'pretix.event.order.placed',
178+
'eventyay.event.order.placed',
179179
_('New order placed'),
180180
),
181181
ParametrizedOrderWebhookEvent(
182-
'pretix.event.order.placed.require_approval',
182+
'eventyay.event.order.placed.require_approval',
183183
_('New order requires approval'),
184184
),
185185
ParametrizedOrderWebhookEvent(
186-
'pretix.event.order.paid',
186+
'eventyay.event.order.paid',
187187
_('Order marked as paid'),
188188
),
189189
ParametrizedOrderWebhookEvent(
190-
'pretix.event.order.canceled',
190+
'eventyay.event.order.canceled',
191191
_('Order canceled'),
192192
),
193193
ParametrizedOrderWebhookEvent(
194-
'pretix.event.order.reactivated',
194+
'eventyay.event.order.reactivated',
195195
_('Order reactivated'),
196196
),
197197
ParametrizedOrderWebhookEvent(
198-
'pretix.event.order.expired',
198+
'eventyay.event.order.expired',
199199
_('Order expired'),
200200
),
201201
ParametrizedOrderWebhookEvent(
202-
'pretix.event.order.modified',
202+
'eventyay.event.order.modified',
203203
_('Order information changed'),
204204
),
205205
ParametrizedOrderWebhookEvent(
206-
'pretix.event.order.contact.changed',
206+
'eventyay.event.order.contact.changed',
207207
_('Order contact address changed'),
208208
),
209209
ParametrizedOrderWebhookEvent(
210-
'pretix.event.order.changed.*',
210+
'eventyay.event.order.changed.*',
211211
_('Order changed'),
212212
),
213213
ParametrizedOrderWebhookEvent(
214-
'pretix.event.order.refund.created.externally',
214+
'eventyay.event.order.refund.created.externally',
215215
_('External refund of payment'),
216216
),
217217
ParametrizedOrderWebhookEvent(
218-
'pretix.event.order.approved',
218+
'eventyay.event.order.approved',
219219
_('Order approved'),
220220
),
221221
ParametrizedOrderWebhookEvent(
222-
'pretix.event.order.denied',
222+
'eventyay.event.order.denied',
223223
_('Order denied'),
224224
),
225225
ParametrizedOrderPositionWebhookEvent(
@@ -243,15 +243,15 @@ def register_default_webhook_events(sender, **kwargs):
243243
_('Event details changed'),
244244
),
245245
ParametrizedSubEventWebhookEvent(
246-
'pretix.subevent.added',
246+
'eventyay.subevent.added',
247247
pgettext_lazy('subevent', 'Event series date added'),
248248
),
249249
ParametrizedSubEventWebhookEvent(
250-
'pretix.subevent.changed',
250+
'eventyay.subevent.changed',
251251
pgettext_lazy('subevent', 'Event series date changed'),
252252
),
253253
ParametrizedSubEventWebhookEvent(
254-
'pretix.subevent.deleted',
254+
'eventyay.subevent.deleted',
255255
pgettext_lazy('subevent', 'Event series date deleted'),
256256
),
257257
)

app/eventyay/base/exporters/json.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
from decimal import Decimal
33

4+
import pytz
45
from django.core.serializers.json import DjangoJSONEncoder
56
from django.dispatch import receiver
67

@@ -13,6 +14,7 @@ class JSONExporter(BaseExporter):
1314
verbose_name = 'Order data (JSON)'
1415

1516
def render(self, form_data):
17+
event_tz = pytz.timezone(self.event.settings.timezone)
1618
jo = {
1719
'event': {
1820
'name': str(self.event.name),
@@ -62,12 +64,13 @@ def render(self, form_data):
6264
}
6365
for question in self.event.questions.all()
6466
],
67+
'timezone': str(event_tz),
6568
'orders': [
6669
{
6770
'code': order.code,
6871
'status': order.status,
6972
'user': order.email,
70-
'datetime': order.datetime,
73+
'datetime': order.datetime.astimezone(event_tz).isoformat(),
7174
'fees': [
7275
{
7376
'type': fee.fee_type,

app/eventyay/base/exporters/orderlist.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ def iterate_orders(self, form_data: dict):
388388
yield self.ProgressSetTotal(total=qs.count())
389389
for order in qs.order_by('datetime').iterator():
390390
tz = pytz.timezone(self.event_object_cache[order.event_id].settings.timezone)
391-
392391
row = [
393392
self.event_object_cache[order.event_id].slug,
394393
order.code,
@@ -397,7 +396,7 @@ def iterate_orders(self, form_data: dict):
397396
order.email,
398397
str(order.phone) if order.phone else '',
399398
order.datetime.astimezone(tz).strftime('%Y-%m-%d'),
400-
order.datetime.astimezone(tz).strftime('%H:%M:%S'),
399+
order.datetime.astimezone(tz).strftime('%H:%M:%S %Z'),
401400
]
402401
try:
403402
row += [
@@ -424,7 +423,7 @@ def iterate_orders(self, form_data: dict):
424423
)
425424

426425
row += [
427-
order.payment_date.astimezone(tz).strftime('%Y-%m-%d') if order.payment_date else '',
426+
order.payment_date.astimezone(tz).strftime('%Y-%m-%d %H:%M:%S %Z') if order.payment_date else '',
428427
full_fee_sum_cache.get(order.id) or Decimal('0.00'),
429428
order.locale,
430429
]
@@ -548,7 +547,7 @@ def iterate_fees(self, form_data: dict):
548547
order.email,
549548
str(order.phone) if order.phone else '',
550549
order.datetime.astimezone(tz).strftime('%Y-%m-%d'),
551-
order.datetime.astimezone(tz).strftime('%H:%M:%S'),
550+
order.datetime.astimezone(tz).strftime('%H:%M:%S %Z'),
552551
op.get_fee_type_display(),
553552
op.description,
554553
op.value,
@@ -728,21 +727,21 @@ def iterate_positions(self, form_data: dict):
728727
order.email,
729728
str(order.phone) if order.phone else '',
730729
order.datetime.astimezone(tz).strftime('%Y-%m-%d'),
731-
order.datetime.astimezone(tz).strftime('%H:%M:%S'),
730+
order.datetime.astimezone(tz).strftime('%H:%M:%S %Z'),
732731
]
733732
if has_subevents:
734733
if op.subevent:
735734
row.append(op.subevent.name)
736735
row.append(
737736
op.subevent.date_from.astimezone(self.event_object_cache[order.event_id].timezone).strftime(
738-
'%Y-%m-%d %H:%M:%S'
737+
'%Y-%m-%d %H:%M:%S %Z'
739738
)
740739
)
741740
if op.subevent.date_to:
742741
row.append(
743742
op.subevent.date_to.astimezone(
744743
self.event_object_cache[order.event_id].timezone
745-
).strftime('%Y-%m-%d %H:%M:%S')
744+
).strftime('%Y-%m-%d %H:%M:%S %Z')
746745
)
747746
else:
748747
row.append('')
@@ -920,16 +919,16 @@ def iterate_list(self, form_data):
920919
for obj in objs:
921920
tz = pytz.timezone(obj.order.event.settings.timezone)
922921
if isinstance(obj, OrderPayment) and obj.payment_date:
923-
d2 = obj.payment_date.astimezone(tz).date().strftime('%Y-%m-%d')
922+
d2 = obj.payment_date.astimezone(tz).strftime('%Y-%m-%d %H:%M:%S %Z')
924923
elif isinstance(obj, OrderRefund) and obj.execution_date:
925-
d2 = obj.execution_date.astimezone(tz).date().strftime('%Y-%m-%d')
924+
d2 = obj.execution_date.astimezone(tz).strftime('%Y-%m-%d %H:%M:%S %Z')
926925
else:
927926
d2 = ''
928927
row = [
929928
obj.order.event.slug,
930929
obj.order.code,
931930
obj.full_id,
932-
obj.created.astimezone(tz).date().strftime('%Y-%m-%d'),
931+
obj.created.astimezone(tz).strftime('%Y-%m-%d %H:%M:%S %Z'),
933932
d2,
934933
obj.get_state_display(),
935934
obj.state,
@@ -990,9 +989,9 @@ def iterate_list(self, form_data):
990989
if has_subevents:
991990
if quota.subevent:
992991
row.append(quota.subevent.name)
993-
row.append(quota.subevent.date_from.astimezone(self.event.timezone).strftime('%Y-%m-%d %H:%M:%S'))
992+
row.append(quota.subevent.date_from.astimezone(self.event.timezone).strftime('%Y-%m-%d %H:%M:%S %Z'))
994993
if quota.subevent.date_to:
995-
row.append(quota.subevent.date_to.astimezone(self.event.timezone).strftime('%Y-%m-%d %H:%M:%S'))
994+
row.append(quota.subevent.date_to.astimezone(self.event.timezone).strftime('%Y-%m-%d %H:%M:%S %Z'))
996995
else:
997996
row.append('')
998997
else:
@@ -1044,7 +1043,7 @@ def iterate_list(self, form_data):
10441043
obj.order.event.slug,
10451044
obj.order.code,
10461045
obj.full_id,
1047-
obj.created.astimezone(tz).date().strftime('%Y-%m-%d'),
1046+
obj.created.astimezone(tz).strftime('%Y-%m-%d %H:%M:%S %Z'),
10481047
gc.secret,
10491048
obj.amount * (-1 if isinstance(obj, OrderRefund) else 1),
10501049
gc.issuer,
@@ -1169,8 +1168,8 @@ def iterate_list(self, form_data):
11691168
row = [
11701169
obj.secret,
11711170
_('Yes') if obj.testmode else _('No'),
1172-
obj.issuance.astimezone(tz).date().strftime('%Y-%m-%d'),
1173-
obj.expires.astimezone(tz).date().strftime('%Y-%m-%d') if obj.expires else '',
1171+
obj.issuance.astimezone(tz).strftime('%Y-%m-%d %H:%M:%S %Z'),
1172+
obj.expires.astimezone(tz).strftime('%Y-%m-%d %H:%M:%S %Z') if obj.expires else '',
11741173
obj.conditions or '',
11751174
obj.currency,
11761175
obj.cached_value,

app/eventyay/base/exporters/waitinglist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def iterate_list(self, form_data):
115115
# which event should be used to output dates in columns "Start date" and "End date"
116116
event_for_date_columns = entry.subevent if entry.subevent else entry.event
117117
tz = pytz.timezone(entry.event.settings.timezone)
118-
datetime_format = '%Y-%m-%d %H:%M:%S'
118+
datetime_format = '%Y-%m-%d %H:%M:%S %Z'
119119

120120
row = [
121121
entry.created.astimezone(tz).strftime(datetime_format), # alternative: .isoformat(),

app/eventyay/base/models/access_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class SubmitterAccessCode(GenerateCode, PretalxModel):
6161

6262
_code_length = 32
6363

64-
log_prefix = 'pretalx.access_code'
64+
log_prefix = 'eventyay.access_code'
6565

6666
class Meta:
6767
unique_together = (('event', 'code'),)

app/eventyay/base/models/information.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class SpeakerInformation(PretalxModel):
5252
upload_to=resource_path,
5353
)
5454

55-
log_prefix = 'speaker_information'
55+
log_prefix = 'eventyay.speaker_information'
5656

5757
@property
5858
def log_parent(self):

app/eventyay/base/models/mail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class MailTemplate(PretalxModel):
6262
special cases, for now.
6363
"""
6464

65-
log_prefix = 'pretalx.mail_template'
65+
log_prefix = 'eventyay.mail_template'
6666

6767
event = models.ForeignKey(
6868
to='Event',

app/eventyay/base/models/question.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class TalkQuestion(OrderedModel, PretalxModel):
247247
objects = ScopedManager(event='event', _manager_class=TalkQuestionManager)
248248
all_objects = ScopedManager(event='event', _manager_class=AllTalkQuestionManager)
249249

250-
log_prefix = 'pretalx.question'
250+
log_prefix = 'eventyay.question'
251251

252252
class Meta:
253253
ordering = ('position', 'id')

app/eventyay/base/models/room.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,29 @@ def with_permission(
4141
):
4242
from .auth import RoomGrant, EventGrant
4343

44-
traits = traits or user.traits
44+
# Normalize traits input
45+
# - If traits is explicitly provided, use it; otherwise, read from user when available
46+
# - Always coerce to a simple list[str] for proper DB array parameterization
47+
if traits is None:
48+
if user is not None:
49+
traits = user.traits
50+
else:
51+
traits = []
52+
4553
allow_empty_traits = not user or user.type == User.UserType.PERSON
54+
55+
# Ensure traits is always a proper list of strings for SQL parameterization
56+
if isinstance(traits, str):
57+
# Accept legacy "(a,b,c)" string format by parsing it into a list
58+
traits = [t.strip() for t in traits.strip("()").split(",") if t.strip()]
59+
else:
60+
try:
61+
# Convert any iterable (set/tuple/queryset) to a list of strings
62+
traits = [str(t) for t in list(traits or [])]
63+
except TypeError:
64+
# Non-iterables (shouldn't happen) fallback to empty list
65+
traits = []
66+
4667
if event.has_permission_implicit(
4768
traits=traits,
4869
permissions=[permission],
@@ -108,8 +129,8 @@ def with_permission(
108129
TRUE = ALL(
109130
SELECT (
110131
CASE jsonb_typeof(d{i}.elem)
111-
WHEN 'array' THEN EXISTS(SELECT 1 FROM jsonb_array_elements(d{i}.elem) e{i}(elem) WHERE e{i}.elem#>>'{{}}' = ANY(%s) )
112-
ELSE d{i}.elem#>>'{{}}' = ANY(%s)
132+
WHEN 'array' THEN EXISTS(SELECT 1 FROM jsonb_array_elements(d{i}.elem) e{i}(elem) WHERE e{i}.elem#>>'{{}}' = ANY(%s::text[]) )
133+
ELSE d{i}.elem#>>'{{}}' = ANY(%s::text[])
113134
END
114135
) FROM jsonb_array_elements( trait_grants->%s ) AS d{i}(elem)
115136
) {ext}
@@ -156,7 +177,7 @@ class Room(VersionedModel, OrderedModel, PretalxModel):
156177
are not in use right now.
157178
"""
158179

159-
log_prefix = "pretalx.room"
180+
log_prefix = "eventyay.room"
160181

161182
deleted = models.BooleanField(default=False)
162183
description = I18nCharField(

0 commit comments

Comments
 (0)