@@ -106,6 +106,7 @@ class ConsentWithdrawView(UserConsentActionView):
106106 template_name = "consent/user/unsubscribe/done.html"
107107 model = models .UserConsent
108108 context_object_name = "consent"
109+ token_salt = consent_settings .UNSUBSCRIBE_SALT
109110
110111 def action (self , consent ):
111112 consent .optout ()
@@ -120,11 +121,47 @@ class ConsentWithdrawUndoView(UserConsentActionView):
120121 """
121122
122123 template_name = "consent/user/unsubscribe/undo.html"
124+ token_salt = consent_settings .UNSUBSCRIBE_SALT
123125
124126 def action (self , consent ):
125127 consent .optouts .all ().delete ()
126128
127129
130+ class ConsentWithdrawAllView (UserConsentActionView ):
131+ """
132+ Withdraws a consent. In the case of a newsletter, it unsubscribes a user
133+ from receiving the newsletter.
134+
135+ Requires a valid link with a token.
136+ """
137+
138+ template_name = "consent/user/unsubscribe_all/done.html"
139+ model = models .UserConsent
140+ context_object_name = "consent"
141+ token_salt = consent_settings .UNSUBSCRIBE_ALL_SALT
142+
143+ def action (self , consent ):
144+ consent .optout (is_everything = True )
145+
146+
147+ class ConsentWithdrawAllUndoView (UserConsentActionView ):
148+ """
149+ This is related to undoing withdrawal of consent in case that the user
150+ clicked the wrong link.
151+
152+ Requires a valid link
153+
154+ This only cancels an withdrawal of everything that was related to this
155+ particular consent. Another withdrawal can still exist.
156+ """
157+
158+ template_name = "consent/user/unsubscribe_all/undo.html"
159+ token_salt = consent_settings .UNSUBSCRIBE_ALL_SALT
160+
161+ def action (self , consent ):
162+ consent .optouts .filter (is_everything = True ).delete ()
163+
164+
128165class ConsentConfirmationReceiveView (UserConsentActionView ):
129166 """
130167 Marks a consent as confirmed, this is important for items that require a
0 commit comments