@@ -60,7 +60,7 @@ def generate_report(contest_id):
6060 submission_count = Submission .query .filter_by (contest_id = contest_id ).count ()
6161
6262 if submission_count == 0 :
63- print (f"⚠️ Warning: No submissions to report on" )
63+ print (f" Warning: No submissions to report on" )
6464 # Continue anyway - empty report is valid
6565
6666 # Step 6: Create report record
@@ -75,7 +75,6 @@ def generate_report(contest_id):
7575 )
7676 db .session .add (report )
7777 db .session .commit ()
78- print (f" Report ID: { report .id } " )
7978 except Exception as db_error :
8079 print (f"Database error creating report: { db_error } " )
8180 traceback .print_exc ()
@@ -93,14 +92,10 @@ def generate_report(contest_id):
9392
9493 try :
9594 if report_type == 'csv' :
96- print (f" Creating CSV builder..." )
9795 builder = CSVReportBuilder (contest , report_metadata )
98- print (f" Generating CSV..." )
9996 file_path = builder .generate ()
10097 else : # pdf
101- print (f" Creating PDF builder..." )
10298 builder = PDFReportBuilder (contest , report_metadata )
103- print (f" Generating PDF..." )
10499 file_path = builder .generate ()
105100
106101 # Verify file exists
@@ -145,7 +140,7 @@ def generate_report(contest_id):
145140 report .error_message = str (e )
146141 db .session .commit ()
147142 except Exception as db_error :
148- print (f"⚠️ Failed to update report status: { db_error } " )
143+ print (f"Failed to update report status: { db_error } " )
149144 db .session .rollback ()
150145
151146 return jsonify ({
@@ -207,7 +202,6 @@ def download_report(report_id):
207202
208203 # Check if report is ready
209204 if report .status != 'completed' :
210- print (f"⚠️ Report not ready: { report .status } " )
211205 return jsonify ({
212206 'error' : 'Report not ready' ,
213207 'status' : report .status ,
@@ -216,16 +210,13 @@ def download_report(report_id):
216210
217211 # Check if file exists
218212 if not report .file_path :
219- print (f"❌ No file path in database" )
220213 return jsonify ({'error' : 'Report file path missing' }), 404
221214
222215 if not os .path .exists (report .file_path ):
223- print (f"❌ File not found: { report .file_path } " )
224216 return jsonify ({'error' : 'Report file not found on disk' }), 404
225217
226218 # Send file
227219 filename = f"contest_{ report .contest_id } _report.{ report .report_type } "
228- print (f"✅ Sending file: { filename } ({ os .path .getsize (report .file_path )} bytes)" )
229220
230221 return send_file (
231222 report .file_path ,
@@ -235,7 +226,7 @@ def download_report(report_id):
235226 )
236227
237228 except Exception as e :
238- print (f"❌ Download error: { e } " )
229+ print (f" Download error: { e } " )
239230 traceback .print_exc ()
240231 return jsonify ({'error' : f'Failed to download report: { str (e )} ' }), 500
241232
@@ -262,7 +253,7 @@ def report_status(report_id):
262253 }), 200
263254
264255 except Exception as e :
265- print (f"❌ Status check error: { e } " )
256+ print (f" Status check error: { e } " )
266257 return jsonify ({'error' : str (e )}), 500
267258
268259
@@ -272,7 +263,6 @@ def report_status(report_id):
272263def preview_report (contest_id ):
273264 """Preview report data without generating full file"""
274265 try :
275- print (f"\n 👁️ Preview request for contest { contest_id } " )
276266
277267 current_user = request .current_user
278268 contest = Contest .query .get_or_404 (contest_id )
@@ -289,9 +279,8 @@ def preview_report(contest_id):
289279 # Fetch preview data with error handling
290280 try :
291281 stats = get_submission_statistics (contest_id )
292- print (f" ✅ Statistics loaded" )
293282 except Exception as e :
294- print (f" ❌ Statistics failed: { e } " )
283+ print (f" Statistics failed: { e } " )
295284 traceback .print_exc ()
296285 return jsonify ({
297286 'error' : 'Failed to fetch statistics' ,
@@ -300,9 +289,8 @@ def preview_report(contest_id):
300289
301290 try :
302291 top_contributors = get_top_contributors (contest_id , limit = top_n )
303- print (f" ✅ Top contributors loaded: { len (top_contributors )} " )
304292 except Exception as e :
305- print (f" ❌ Contributors failed: { e } " )
293+ print (f" Contributors failed: { e } " )
306294 traceback .print_exc ()
307295 top_contributors = []
308296
@@ -321,7 +309,7 @@ def preview_report(contest_id):
321309 }), 200
322310
323311 except Exception as e :
324- print (f"❌ Preview error: { e } " )
312+ print (f" Preview error: { e } " )
325313 traceback .print_exc ()
326314 return jsonify ({'error' : str (e )}), 500
327315
@@ -332,7 +320,6 @@ def preview_report(contest_id):
332320def delete_report (report_id ):
333321 """Delete a generated report"""
334322 try :
335- print (f"\n 🗑️ Delete request for report { report_id } " )
336323
337324 current_user = request .current_user
338325 report = ContestReport .query .get_or_404 (report_id )
@@ -346,23 +333,20 @@ def delete_report(report_id):
346333 if report .file_path and os .path .exists (report .file_path ):
347334 try :
348335 os .remove (report .file_path )
349- print (f"✅ Deleted file: { report .file_path } " )
350336 except Exception as e :
351- print (f"⚠️ File delete error: { e } " )
337+ print (f" File delete error: { e } " )
352338
353339 # Delete database record
354340 db .session .delete (report )
355341 db .session .commit ()
356342
357- print (f"✅ Report { report_id } deleted successfully" )
358-
359343 return jsonify ({
360344 'success' : True ,
361345 'message' : 'Report deleted successfully'
362346 }), 200
363347
364348 except Exception as e :
365- print (f"❌ Delete error: { e } " )
349+ print (f" Delete error: { e } " )
366350 traceback .print_exc ()
367351 return jsonify ({'error' : str (e )}), 500
368352
@@ -382,21 +366,21 @@ def report_health():
382366 db .session .execute ('SELECT 1' )
383367 dependencies ['database' ] = True
384368 except Exception as e :
385- print (f"❌ Database check failed: { e } " )
369+ print (f" Database check failed: { e } " )
386370
387371 # Check reportlab
388372 try :
389373 import reportlab
390374 dependencies ['reportlab' ] = True
391375 except ImportError :
392- print ("❌ reportlab not installed" )
376+ print (" reportlab not installed" )
393377
394378 # Check matplotlib
395379 try :
396380 import matplotlib
397381 dependencies ['matplotlib' ] = True
398382 except ImportError :
399- print ("❌ matplotlib not installed" )
383+ print (" matplotlib not installed" )
400384
401385 # Check reports directory
402386 try :
@@ -412,7 +396,7 @@ def report_health():
412396 os .remove (test_file )
413397 dependencies ['reports_directory' ] = True
414398 except Exception as e :
415- print (f"❌ Reports directory check failed: { e } " )
399+ print (f" Reports directory check failed: { e } " )
416400
417401 all_ok = all (dependencies .values ())
418402
0 commit comments