@requires(conf.ALLOW_SUBSCRIPTIONS)<EOL>@csrf_protect<EOL>def update_subscription(request, ident):
try:<EOL><INDENT>subscription = Subscription.objects.get(ident=ident)<EOL><DEDENT>except Subscription.DoesNotExist:<EOL><INDENT>return respond('<STR_LIT>', {}, request)<EOL><DEDENT>if request.POST:<EOL><INDENT>form = UpdateSubscriptionForm(request.POST, instance=subscription)<EOL>if form.is_valid():<EOL><INDENT>if form.cleaned_data['<STR_LIT>']:<EOL><INDENT>subscription.delete()<EOL>return respond('<STR_LIT>', {<EOL>'<STR_LIT:email>': subscription.email,<EOL>})<EOL><DEDENT>else:<EOL><INDENT>form.save()<EOL><DEDENT>return HttpResponseRedirect(request.get_full_path())<EOL><DEDENT><DEDENT>else:<EOL><INDENT>form = UpdateSubscriptionForm(instance=subscription)<EOL><DEDENT>context = csrf(request)<EOL>context.update({<EOL>'<STR_LIT>': form,<EOL>'<STR_LIT>': subscription,<EOL>'<STR_LIT>': Service.objects.all(),<EOL>})<EOL>return respond('<STR_LIT>', context, request)<EOL>
Shows subscriptions options for a verified subscriber.