aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTudor Roman2018-10-10 20:10:40 +0300
committerTudor Roman2018-10-10 20:10:40 +0300
commit6ee229624295e5e71c706c79570d9031528dc2a2 (patch)
tree45d610a5bda2242127df0146ed724aa4146f4dda
parenta864ebead8785b55c1d73b3b530daad1b688a29a (diff)
downloadrmi_scripts-6ee229624295e5e71c706c79570d9031528dc2a2.tar.gz
rmi_scripts-6ee229624295e5e71c706c79570d9031528dc2a2.zip
added cleanup
-rwxr-xr-xcleanup21
1 files changed, 21 insertions, 0 deletions
diff --git a/cleanup b/cleanup
new file mode 100755
index 0000000..fb25e2c
--- /dev/null
+++ b/cleanup
@@ -0,0 +1,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']])