mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2024-11-17 06:19:24 +08:00
Polished postmigration scripts
This commit is contained in:
parent
80f8aa5d66
commit
97374442f7
2 changed files with 3 additions and 3 deletions
|
@ -41,7 +41,7 @@ def populate_subjects(sender, **kwargs):
|
|||
csv_files = [f for f in os.listdir(root_path) if f.endswith('.csv')]
|
||||
added_courses = 0
|
||||
existing_courses = 0
|
||||
print('Adding courses\n')
|
||||
print('--- Adding Courses ---')
|
||||
for csv_file in csv_files:
|
||||
# The filename contains coursename
|
||||
filename = os.path.splitext(csv_file)[0]
|
||||
|
@ -65,4 +65,4 @@ def populate_subjects(sender, **kwargs):
|
|||
added_courses += 1
|
||||
|
||||
print('Added', added_courses, 'courses')
|
||||
print(existing_courses, 'existing courses skipped\n')
|
||||
print('Skipped', existing_courses, 'already existing courses\n')
|
||||
|
|
|
@ -88,7 +88,7 @@ def populate_subjects(sender, **kwargs):
|
|||
csv_file_path = os.path.join(root_path, csv_file)
|
||||
# Filename contains course of subjects
|
||||
filename = os.path.splitext(csv_file)[0]
|
||||
print('Reading subjects from', filename)
|
||||
print('---', 'Adding Subjects from', filename, '---')
|
||||
with open(csv_file_path, newline='') as csvfile:
|
||||
|
||||
reader = csv.reader(csvfile)
|
||||
|
|
Loading…
Reference in a new issue