From 7f5c9202bbcae6511081f826952450410428683b Mon Sep 17 00:00:00 2001 From: spitkov Date: Mon, 16 Sep 2024 14:10:51 +0200 Subject: [PATCH] fix fix fix --- app.py | 4 +++- templates/file_info.html | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index 1533397..6b7df1b 100644 --- a/app.py +++ b/app.py @@ -276,6 +276,7 @@ def redirect_vanity(vanity, password=None): entered_password = request.form.get('password') if entered_password != stored_password: return render_template('password_prompt.html', vanity=vanity, error="Incorrect password", content_type=content_type) + password = entered_password # Set the password for use in raw_url else: return render_template('password_prompt.html', vanity=vanity, error=None, content_type=content_type) @@ -308,7 +309,8 @@ def redirect_vanity(vanity, password=None): raw_url=raw_url, vanity=vanity, user_id=user_id, - is_private=is_private) + is_private=is_private, + password=password) elif content_type == 'pastebin': try: lexer = guess_lexer(content_data) diff --git a/templates/file_info.html b/templates/file_info.html index 651f948..4d1e9a2 100644 --- a/templates/file_info.html +++ b/templates/file_info.html @@ -115,21 +115,21 @@ {% if is_embeddable %}
{% if filename.lower().endswith(('.jpg', '.jpeg', '.png', '.gif', '.svg')) %} - {{ filename }} + {{ filename }} {% elif filename.lower().endswith('.pdf') %} - + {% endif %}
{% endif %}
- Download - View Raw + Download + View Raw {% if current_user.is_authenticated and current_user.id == user_id %} {% if filename.lower().endswith(('.txt', '.html', '.css', '.js', '.py', '.md')) or '.' not in filename %} - Edit + Edit {% endif %} -
+
{% endif %}