mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Confirm disabling all notifications (#1845)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{% extends "pretixcontrol/auth/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Disable notifications" %}{% endblock %}
|
||||
{% block content %}
|
||||
<form action="" method="post" class="form-signin">
|
||||
{% csrf_token %}
|
||||
<div class="text-center">
|
||||
<p>Please confirm that you no longer want to receive notifications for any of your events.</p>
|
||||
<p><button type="submit" class="btn btn-primary" value="Disable notifications">Disable notifications</button></p>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -576,7 +576,9 @@ class User2FARegenerateEmergencyView(RecentAuthenticationRequiredMixin, Template
|
||||
|
||||
|
||||
class UserNotificationsDisableView(TemplateView):
|
||||
def get(self, request, *args, **kwargs):
|
||||
template_name = 'pretixcontrol/user/notifications_disable.html'
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
user = get_object_or_404(User, notifications_token=kwargs.get('token'), pk=kwargs.get('id'))
|
||||
user.notifications_send = False
|
||||
user.save()
|
||||
|
||||
Reference in New Issue
Block a user