From 85219d44500e74edb45560cb308b09ab022eec24 Mon Sep 17 00:00:00 2001 From: Daniel Muckerman Date: Sat, 31 Oct 2020 20:09:18 -0400 Subject: [PATCH] Fix some issues --- app.py | 9 ++++----- requirements.txt | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index 74553b1..c3e8584 100644 --- a/app.py +++ b/app.py @@ -4,7 +4,6 @@ from ldap3 import Server, Connection, ALL, MODIFY_REPLACE from flask import Flask, g, request, session, redirect, url_for, render_template from flask_simpleldap import LDAP from flask_bootstrap import Bootstrap -from readability import Document from readabilipy import simple_json_from_html_string import os import sqlite3 @@ -105,9 +104,9 @@ def login(): session['user_id'] = request.form['user'] session['passwd'] = request.form['passwd'] - if session['next']: - next = session['next'] - session['next'] = '' + if 'next_redirect' in session: + next = session['next_redirect'] + session['next_redirect'] = '' return redirect(next) return redirect('/') return render_template('login.j2') @@ -134,7 +133,7 @@ def read_article(article_id): @app.route('/add', methods=['GET', 'POST']) def add_url(): if not 'user_id' in session: - session['next'] = request.url + session['next_redirect'] = request.url return redirect(url_for('login')) if request.method == 'POST': url = request.form['url'] diff --git a/requirements.txt b/requirements.txt index 2e91653..bd3e533 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,5 +4,5 @@ Flask-Login==0.5.0 Flask-SimpleLDAP==1.4.0 python-ldap==3.2.0 ldap3==2.7 -readability-lxml==0.8.1 +readabilipy==0.2.0 requests==2.24.0 \ No newline at end of file