Merge pull request #2 from UnstableVortexSecurity/profileview

profileview done
This commit is contained in:
Torma Kristóf 2020-11-28 06:37:24 +01:00 committed by GitHub
commit 872d1ef5ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -3,7 +3,7 @@
{% block content %}
{% if current_user.is_authenticated %}
<div>
<h1>Welcome {{ user.username }}</h1>
<h1>Welcome {{ current_user.username }}</h1>
<a href="{{ url_for('UploadView:index') }}" class="btn btn-primary">Upload</a>
</div>
<br>

View File

@ -2,6 +2,11 @@
from flask import render_template
from flask_classful import FlaskView
from flask_security.decorators import login_required
from flask_security import current_user
from models import Item
"""
Profile VIEW
"""
@ -14,5 +19,9 @@ __version__text__ = "1"
class ProfileView(FlaskView):
@login_required
def index(self):
return render_template('profile.html')
useritems = Item.query.filter_by(uploader_id=current_user.id)
return render_template('profile.html', images=useritems)