#NEWLINE# @ view_config ( route_name = 'unsubscribe' , renderer = 'h:templates/unsubscribe.html.jinja2' ) #NEWLINE# def unsubscribe( request ) : #NEWLINE# #INDENT# token = request . matchdict [ 'token' ] #NEWLINE# payload = request . registry . notification_serializer . loads ( token ) #NEWLINE# subscriptions = Subscriptions . get_templates_for_uri_and_type ( payload [ 'uri' ] , payload [ 'type' ] ) #NEWLINE# for s in subscriptions : #NEWLINE# #INDENT# if s . active : #NEWLINE# #INDENT# s . active = False #NEWLINE# request . db . add ( request ) #NEWLINE# #UNINDENT# #UNINDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# }