@app.route('/unsubscribe/<subscription_key>', methods=['GET', 'POST'])
def unsubscribe(subscription_key):
    subscription = updater.subscription_for_key(subscription_key)
    if subscription:
        sr_id = subscription.sr_id
        updater.unsubscribe_with_key(subscription_key)
        destination = url_for('show_request', request_id=sr_id)
    else:
        destination = url_for('index')
    flash(u'You‘ve been unsubscribed from this service request. You will no longer receive e-mails when it is updated.')
    return redirect(destination)
@app.route('/unsubscribe/<subscription_key>', methods=['GET', 'POST'])
def unsubscribe(subscription_key):
    subscription = updater.subscription_for_key(subscription_key)
    if subscription:
        sr_id = subscription.sr_id
        updater.unsubscribe_with_key(subscription_key)
        destination = url_for('show_request', request_id=sr_id)
    else:
        destination = url_for('index')
    flash(u'You‘ve been unsubscribed from this service request. You will no longer receive e-mails when it is updated.')
    return redirect(destination)