Update Webserver.py

add header in the export log in csv function
This commit is contained in:
jeanGaston 2024-05-22 20:26:12 +02:00
parent 646033244f
commit a44fd1cb30

View File

@ -35,6 +35,8 @@ def export_logs():
# Create a file-like string to write logs
log_output = io.StringIO()
log_line = "TimeStamp,User,Tag UID,Door ID,Granted,\n"
log_output.write(log_line)
for log in logs:
log_line = f"{log[0]},{log[1]},{log[2]},{log[3]},{'Yes' if log[4] else 'No'},\n"
log_output.write(log_line)