aboutsummaryrefslogtreecommitdiff
path: root/cleanup
blob: fb25e2cedc39580121454acb3c85601b5c7763c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3
#
# Deletes users from CMS
#
# Made by Tudor Roman, public domain
#
# This script expects as its first argument a table generated by add_users.
#

import csv
import sys
from subprocess import call

if len(sys.argv) != 2:
    print("Usage: add_participations <csv_file> <contest_id>")
    sys.exit(1)

with open(sys.argv[1]) as file:
    reader = csv.DictReader(file, delimiter=',')
    for row in reader:
        call(['cmsRemoveUser', row['username']])