Commit 75df51f1 authored by Vincent Calame's avatar Vincent Calame

New badge field

parent 6af938a4
......@@ -29,7 +29,7 @@ module XlsExport
bold_style = p.workbook.styles.add_style(b: true)
row = []
row << 'ID'
row << 'Validé'
row << 'Badge'
row << 'Création'
row << 'Mise à jour'
row << 'Confirmé'
......@@ -104,7 +104,7 @@ module XlsExport
row = []
row << registration.user_id
row << ( registration.attended ? 'X' : '' )
row << registration.badge
row << registration.created_at
row << registration.updated_at
row << registration.confirmation_date
......
......@@ -2,15 +2,15 @@
import sys, shutil, csv, os
COLUMNNAME = sys.argv[1]
ORIGIN = sys.argv[2]
DESTINATION = sys.argv[3]
ORIGIN = sys.argv[1]
DESTINATION = sys.argv[2]
def parseRow(row, columnname):
def parseRow(row):
user_id = row[0]
writer.write("UPDATE registrations SET ")
writer.write(columnname)
writer.write(COLUMNNAME)
writer.write(" = '")
writer.write("X")
writer.write("' WHERE user_id = ")
......@@ -27,4 +27,4 @@ with open(ORIGIN, "r", encoding="UTF-8", newline='') as csvfile:
print("doublon : " + user_id)
else:
id_set.add(user_id)
parseRow(row, "criblage")
parseRow(row)
class AddBadgeField < ActiveRecord::Migration
def change
add_column :registrations, :badge, :string
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment