Browse Source

Fix some issues

mistress
Daniel Muckerman 4 years ago
parent
commit
85219d4450
2 changed files with 5 additions and 6 deletions
  1. +4
    -5
      app.py
  2. +1
    -1
      requirements.txt

+ 4
- 5
app.py View File

@ -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 import Flask, g, request, session, redirect, url_for, render_template
from flask_simpleldap import LDAP from flask_simpleldap import LDAP
from flask_bootstrap import Bootstrap from flask_bootstrap import Bootstrap
from readability import Document
from readabilipy import simple_json_from_html_string from readabilipy import simple_json_from_html_string
import os import os
import sqlite3 import sqlite3
@ -105,9 +104,9 @@ def login():
session['user_id'] = request.form['user'] session['user_id'] = request.form['user']
session['passwd'] = request.form['passwd'] 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(next)
return redirect('/') return redirect('/')
return render_template('login.j2') return render_template('login.j2')
@ -134,7 +133,7 @@ def read_article(article_id):
@app.route('/add', methods=['GET', 'POST']) @app.route('/add', methods=['GET', 'POST'])
def add_url(): def add_url():
if not 'user_id' in session: if not 'user_id' in session:
session['next'] = request.url
session['next_redirect'] = request.url
return redirect(url_for('login')) return redirect(url_for('login'))
if request.method == 'POST': if request.method == 'POST':
url = request.form['url'] url = request.form['url']

+ 1
- 1
requirements.txt View File

@ -4,5 +4,5 @@ Flask-Login==0.5.0
Flask-SimpleLDAP==1.4.0 Flask-SimpleLDAP==1.4.0
python-ldap==3.2.0 python-ldap==3.2.0
ldap3==2.7 ldap3==2.7
readability-lxml==0.8.1
readabilipy==0.2.0
requests==2.24.0 requests==2.24.0

Loading…
Cancel
Save