Fixed skip duplicate records review button functionality

This commit is contained in:
2025-10-31 09:44:04 -04:00
parent c89b876ba0
commit a4c584468c
3 changed files with 10 additions and 5 deletions
+2
View File
@@ -82,6 +82,8 @@ target/
profile_default/ profile_default/
ipython_config.py ipython_config.py
.stignore
# pyenv # pyenv
# For a library or package, you might want to ignore these files since the code is # For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in: # intended to run in multiple environments; otherwise, check them in:
+7 -5
View File
@@ -6605,11 +6605,13 @@ def import_time_attendance():
try: try:
# Check if this is coming from invalid review (file is already in session) # Check if this is coming from invalid review (file is already in session)
coming_from_invalid_review = request.form.get('from_invalid_review', 'false').lower() == 'true' coming_from_invalid_review = request.form.get('from_invalid_review', 'false').lower() == 'true'
coming_from_duplicate_review = request.form.get('from_duplicate_review', 'false').lower() == 'true'
print(f"\n🔍 IMPORT FLOW DEBUG:") print(f"\n🔍 IMPORT FLOW DEBUG:")
print(f" Coming from invalid review: {coming_from_invalid_review}") print(f" Coming from invalid review: {coming_from_invalid_review}")
print(f" Coming from duplicate review: {coming_from_duplicate_review}")
if coming_from_invalid_review:
if coming_from_invalid_review or coming_from_duplicate_review:
# Retrieve file from session # Retrieve file from session
if 'pending_import_file' not in session or 'pending_import_filename' not in session: if 'pending_import_file' not in session or 'pending_import_filename' not in session:
flash('Session expired. Please upload the file again.', 'error') flash('Session expired. Please upload the file again.', 'error')
@@ -6678,8 +6680,8 @@ def import_time_attendance():
# Check if this is coming from duplicate review # Check if this is coming from duplicate review
force_import_hashes = request.form.getlist('force_import_hashes[]') force_import_hashes = request.form.getlist('force_import_hashes[]')
# If analyzing for duplicates, show review page (but not if coming from invalid review) # If analyzing for duplicates, show review page (but not if coming from invalid/duplicate review)
if analyze_duplicates and not force_import_hashes and not coming_from_invalid_review: if analyze_duplicates and not force_import_hashes and not coming_from_invalid_review and not coming_from_duplicate_review:
print("🔍 Analyzing for duplicates...") print("🔍 Analyzing for duplicates...")
duplicate_analysis = import_service.analyze_for_duplicates(temp_path) duplicate_analysis = import_service.analyze_for_duplicates(temp_path)
@@ -371,6 +371,7 @@
<input type="hidden" name="skip_duplicates" value="true"> <input type="hidden" name="skip_duplicates" value="true">
<input type="hidden" name="import_source" value="Import with Duplicates - {{ filename }}"> <input type="hidden" name="import_source" value="Import with Duplicates - {{ filename }}">
<input type="hidden" name="project_id" value="{{ project_id }}"> <input type="hidden" name="project_id" value="{{ project_id }}">
<input type="hidden" name="from_duplicate_review" value="true">
<div class="duplicates-container"> <div class="duplicates-container">
{% for duplicate in analysis.duplicates %} {% for duplicate in analysis.duplicates %}