refactor: Un peu de nettoyage (debugging prints, routes, …)

This commit is contained in:
Darks 2020-07-18 10:13:21 +02:00
parent 34bc74b8e5
commit ec73177f48
Signed by: Darks
GPG Key ID: F61F10FA138E797C
5 changed files with 1 additions and 11 deletions

View File

@ -61,11 +61,6 @@ def login():
@app.route('/deconnexion')
@login_required
def logout():
try:
print(request.referrer)
except Exception as e:
print('No referrer:', e)
logout_user()
flash('Déconnexion réussie', 'info')
if request.referrer:

View File

@ -24,7 +24,6 @@ def delete_notification(id=None):
if type(id) == int:
notification = Notification.query.get(id)
print(">", notification)
if notification:
# Only current user or admin can delete notifications
if notification.owner_id == current_user.id:

View File

@ -35,8 +35,6 @@ def adm_edit_account(user_id):
setattr(GroupForm, "user_groups", [f'g{g.id}' for g in user.groups])
group_form = GroupForm(prefix="group")
print(group_form.__dict__.items())
if form.submit.data:
if form.validate_on_submit():
newname = form.username.data

View File

@ -34,8 +34,6 @@ def forum_page(f):
or ("/actus" not in f.url and not f.sub_forums)) and (
V5Config.ENABLE_GUEST_POST or current_user.is_authenticated):
print("User can post topic")
# First create the thread, then the comment, then the topic
th = Thread()
db.session.add(th)

View File

@ -6,7 +6,7 @@
{% block content %}
<section class="form">
<a href="/user/{{ user.name }}">Visiter la page de profil de {{ user.name }}</a>
<a href="{{ url_for('user', username=user.name) }}">Visiter la page de profil de {{ user.name }}</a>
<form action="{{ url_for('adm_edit_account', user_id=user.id) }}" method="post" enctype="multipart/form-data">
{{ form.hidden_tag() }}
<h2>Informations</h2>