mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
@@ -26,7 +26,7 @@ from django.utils.translation import gettext_lazy as _, pgettext_lazy
|
|||||||
|
|
||||||
from pretix.base.models import (
|
from pretix.base.models import (
|
||||||
Discount, Item, ItemCategory, Order, Question, Quota, SubEvent, TaxRule,
|
Discount, Item, ItemCategory, Order, Question, Quota, SubEvent, TaxRule,
|
||||||
Voucher,
|
Voucher, WaitingListEntry,
|
||||||
)
|
)
|
||||||
|
|
||||||
from .logentrytype_registry import ( # noqa
|
from .logentrytype_registry import ( # noqa
|
||||||
@@ -145,3 +145,15 @@ class TaxRuleLogEntryType(EventLogEntryType):
|
|||||||
object_link_viewname = 'control:event.settings.tax.edit'
|
object_link_viewname = 'control:event.settings.tax.edit'
|
||||||
object_link_argname = 'rule'
|
object_link_argname = 'rule'
|
||||||
content_type = TaxRule
|
content_type = TaxRule
|
||||||
|
|
||||||
|
|
||||||
|
class WaitingListEntryLogEntryType(EventLogEntryType):
|
||||||
|
object_link_wrapper = _('{val}')
|
||||||
|
object_link_viewname = 'control:event.orders.waitinglist'
|
||||||
|
content_type = WaitingListEntry
|
||||||
|
|
||||||
|
def get_object_link_info(self, logentry) -> Optional[dict]:
|
||||||
|
info = super().get_object_link_info(logentry)
|
||||||
|
if info and 'href' in info:
|
||||||
|
info['href'] += '?status=a&entry=' + str(logentry.content_object.pk)
|
||||||
|
return info
|
||||||
|
|||||||
@@ -218,7 +218,6 @@ class WaitingListEntry(LoggedModel):
|
|||||||
'waitinglistentry': self.pk,
|
'waitinglistentry': self.pk,
|
||||||
'subevent': self.subevent.pk if self.subevent else None,
|
'subevent': self.subevent.pk if self.subevent else None,
|
||||||
}, user=user, auth=auth)
|
}, user=user, auth=auth)
|
||||||
self.log_action('pretix.event.orders.waitinglist.voucher_assigned', user=user, auth=auth)
|
|
||||||
self.voucher = v
|
self.voucher = v
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
@@ -234,6 +233,7 @@ class WaitingListEntry(LoggedModel):
|
|||||||
),
|
),
|
||||||
user=user,
|
user=user,
|
||||||
auth=auth,
|
auth=auth,
|
||||||
|
log_entry_type='pretix.event.orders.waitinglist.voucher_assigned',
|
||||||
)
|
)
|
||||||
|
|
||||||
def send_mail(self, subject: Union[str, LazyI18nString], template: Union[str, LazyI18nString],
|
def send_mail(self, subject: Union[str, LazyI18nString], template: Union[str, LazyI18nString],
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ from pretix.base.logentrytypes import (
|
|||||||
DiscountLogEntryType, EventLogEntryType, ItemCategoryLogEntryType,
|
DiscountLogEntryType, EventLogEntryType, ItemCategoryLogEntryType,
|
||||||
ItemLogEntryType, LogEntryType, OrderLogEntryType, QuestionLogEntryType,
|
ItemLogEntryType, LogEntryType, OrderLogEntryType, QuestionLogEntryType,
|
||||||
QuotaLogEntryType, TaxRuleLogEntryType, VoucherLogEntryType,
|
QuotaLogEntryType, TaxRuleLogEntryType, VoucherLogEntryType,
|
||||||
log_entry_types,
|
WaitingListEntryLogEntryType, log_entry_types,
|
||||||
)
|
)
|
||||||
from pretix.base.models import (
|
from pretix.base.models import (
|
||||||
Checkin, CheckinList, Event, ItemVariation, LogEntry, OrderPosition,
|
Checkin, CheckinList, Event, ItemVariation, LogEntry, OrderPosition,
|
||||||
@@ -697,11 +697,7 @@ class CoreUserImpersonatedLogEntryType(UserImpersonatedLogEntryType):
|
|||||||
'the last request was less than 24 hours ago.'),
|
'the last request was less than 24 hours ago.'),
|
||||||
'pretix.organizer.deleted': _('The organizer "{name}" has been deleted.'),
|
'pretix.organizer.deleted': _('The organizer "{name}" has been deleted.'),
|
||||||
'pretix.waitinglist.voucher': _('A voucher has been sent to a person on the waiting list.'), # legacy
|
'pretix.waitinglist.voucher': _('A voucher has been sent to a person on the waiting list.'), # legacy
|
||||||
'pretix.event.orders.waitinglist.voucher_assigned': _('A voucher has been sent to a person on the waiting list.'),
|
|
||||||
'pretix.event.orders.waitinglist.deleted': _('An entry has been removed from the waiting list.'),
|
|
||||||
'pretix.event.order.waitinglist.transferred': _('An entry has been transferred to another waiting list.'), # legacy
|
'pretix.event.order.waitinglist.transferred': _('An entry has been transferred to another waiting list.'), # legacy
|
||||||
'pretix.event.orders.waitinglist.changed': _('An entry has been changed on the waiting list.'),
|
|
||||||
'pretix.event.orders.waitinglist.added': _('An entry has been added to the waiting list.'),
|
|
||||||
'pretix.team.created': _('The team has been created.'),
|
'pretix.team.created': _('The team has been created.'),
|
||||||
'pretix.team.changed': _('The team settings have been changed.'),
|
'pretix.team.changed': _('The team settings have been changed.'),
|
||||||
'pretix.team.deleted': _('The team has been deleted.'),
|
'pretix.team.deleted': _('The team has been deleted.'),
|
||||||
@@ -903,3 +899,13 @@ class LegacyCheckinLogEntryType(OrderLogEntryType):
|
|||||||
datetime=dt_formatted,
|
datetime=dt_formatted,
|
||||||
list=checkin_list
|
list=checkin_list
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@log_entry_types.new_from_dict({
|
||||||
|
'pretix.event.orders.waitinglist.voucher_assigned': _('A voucher has been sent to a person on the waiting list.'),
|
||||||
|
'pretix.event.orders.waitinglist.deleted': _('An entry has been removed from the waiting list.'),
|
||||||
|
'pretix.event.orders.waitinglist.changed': _('An entry has been changed on the waiting list.'),
|
||||||
|
'pretix.event.orders.waitinglist.added': _('An entry has been added to the waiting list.'),
|
||||||
|
})
|
||||||
|
class CoreWaitingListEntryLogEntryType(WaitingListEntryLogEntryType):
|
||||||
|
pass
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from django_scopes import scope, scopes_disabled
|
from django_scopes import scope, scopes_disabled
|
||||||
|
|
||||||
from pretix.base.logentrytypes import (
|
from pretix.base.logentrytypes import (
|
||||||
EventLogEntryType, OrderLogEntryType, log_entry_types,
|
EventLogEntryType, OrderLogEntryType, WaitingListEntryLogEntryType,
|
||||||
|
log_entry_types,
|
||||||
)
|
)
|
||||||
from pretix.base.models import SubEvent
|
from pretix.base.models import SubEvent
|
||||||
from pretix.base.signals import (
|
from pretix.base.signals import (
|
||||||
@@ -130,6 +131,11 @@ class SendmailPluginOrderLogEntryType(OrderLogEntryType):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@log_entry_types.new('pretix.plugins.sendmail.waitinglist.email.sent', _('The person on the waiting list received a mass email.'))
|
||||||
|
class SendmailPluginWaitingListLogEntryType(WaitingListEntryLogEntryType):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
@log_entry_types.new('pretix.plugins.sendmail.rule.added', _('An email rule was created'))
|
@log_entry_types.new('pretix.plugins.sendmail.rule.added', _('An email rule was created'))
|
||||||
@log_entry_types.new('pretix.plugins.sendmail.rule.changed', _('An email rule was updated'))
|
@log_entry_types.new('pretix.plugins.sendmail.rule.changed', _('An email rule was updated'))
|
||||||
@log_entry_types.new('pretix.plugins.sendmail.rule.order.email.sent', _('A scheduled email was sent to the order'))
|
@log_entry_types.new('pretix.plugins.sendmail.rule.order.email.sent', _('A scheduled email was sent to the order'))
|
||||||
|
|||||||
@@ -201,4 +201,5 @@ def send_mails_to_waitinglist(event: Event, user: int, subject: dict, message: d
|
|||||||
),
|
),
|
||||||
user=user,
|
user=user,
|
||||||
attach_cached_files=attachments,
|
attach_cached_files=attachments,
|
||||||
|
log_entry_type='pretix.plugins.sendmail.waitinglist.email.sent',
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user