diff --git a/.flaskenv b/.flaskenv deleted file mode 100644 index e581145..0000000 --- a/.flaskenv +++ /dev/null @@ -1,3 +0,0 @@ -FLASK_APP=Pycloud.py -FLASK_ENV=development -SECRET_KEY='key' \ No newline at end of file diff --git a/Need.txt b/Need.txt index e7adec5..497a7ff 100644 --- a/Need.txt +++ b/Need.txt @@ -2,11 +2,7 @@ Packages: python3 virtualenv on Virtual environment -python-dotenv -flask -flask-wtf -flask-sqlalchemy -flask-migrate +python-dotenv, flask, flask-wtf, flask-sqlalchemy, flask-migrate, flask-login - - How to install your 'Pycloud' with development environment: - Install python3 (need python3 in PATH, you can download Python on the Website and check the 'add to PATH') and virtualenv ('pip3 install virtualenv'). diff --git a/app/database.py b/app/database.py index 2637444..2dd262c 100644 --- a/app/database.py +++ b/app/database.py @@ -15,7 +15,7 @@ def updatedata(username): folder = os.path.join(app.config['FILES_DIR'], user.username) files = listdir(folder) for f in files: - filetodb = File(name = f, user = user, folder=folder) + filetodb = File(name = f, user = user, folder=user.username) db.session.add(filetodb) db.session.commit() diff --git a/app/routes.py b/app/routes.py index 3723467..2d92ae2 100644 --- a/app/routes.py +++ b/app/routes.py @@ -132,7 +132,7 @@ def view(): return render_template('view.html', title=words['nameView'], dico=words, userlogged=current_user, users = User.query.all()) files = [] for filefromdb in File.query.all(): - if filefromdb.user == current_user: + if filefromdb.folder == current_user.username: files.append(filefromdb) if not len(files): flash(words['ErrorNoFiles']) @@ -157,7 +157,7 @@ def viewAdmin(id): return redirect(url_for('home')) files = [] for filefromdb in File.query.all(): - if filefromdb.user == user: + if filefromdb.folder == user.username: files.append(filefromdb) if not len(files): flash(words['ErrorNoFiles'])