Fixed flash message in confirm_save.py
This commit is contained in:
parent
312a54e624
commit
5c22dbcc31
@ -50,5 +50,4 @@ def confirm_save():
|
||||
|
||||
# Clear session data after successful insertion
|
||||
session.pop('assets', None)
|
||||
flash("Data successfully saved to the database.", "success")
|
||||
return redirect('/viewall')
|
@ -8,34 +8,20 @@
|
||||
<body>
|
||||
<h1>Upload CSV File</h1>
|
||||
|
||||
<!-- Display error messages -->
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
<!-- Display flash messages (only errors) -->
|
||||
{% with messages = get_flashed_messages(category_filter=["error"]) %}
|
||||
{% if messages %}
|
||||
<details>
|
||||
<summary>Errors found during submission (click to expand):</summary>
|
||||
<ul>
|
||||
{% for category, message in messages %}
|
||||
<li><strong>{{ category }}:</strong> {{ message }}</li>
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<!-- Display validation errors if any -->
|
||||
{% if errors %}
|
||||
<details>
|
||||
<summary>
|
||||
Errors found in the CSV file (click to expand):
|
||||
</summary>
|
||||
<ul>
|
||||
{% for error in errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</details>
|
||||
{% endif %}
|
||||
|
||||
<!-- Upload form -->
|
||||
<form action="/uploadcsv" method="POST" enctype="multipart/form-data">
|
||||
<label for="file">Choose a CSV file:</label>
|
||||
|
Loading…
Reference in New Issue
Block a user