mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 17:42:24 +00:00
Fix import
This commit is contained in:
parent
e04e432292
commit
bff49889c5
@ -164,7 +164,6 @@ class Command(BaseCommand):
|
|||||||
"is_staff": args[18] == "ADMIN",
|
"is_staff": args[18] == "ADMIN",
|
||||||
"is_superuser": args[18] == "ADMIN",
|
"is_superuser": args[18] == "ADMIN",
|
||||||
}
|
}
|
||||||
print(obj_dict)
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
TFJMUser.objects.create(**obj_dict)
|
TFJMUser.objects.create(**obj_dict)
|
||||||
self.stdout.write(self.style.SUCCESS("Users imported"))
|
self.stdout.write(self.style.SUCCESS("Users imported"))
|
||||||
@ -250,7 +249,6 @@ class Command(BaseCommand):
|
|||||||
Solution.objects.create(**obj_dict)
|
Solution.objects.create(**obj_dict)
|
||||||
except:
|
except:
|
||||||
print("Solution exists")
|
print("Solution exists")
|
||||||
continue
|
|
||||||
self.stdout.write(self.style.SUCCESS("Solutions imported"))
|
self.stdout.write(self.style.SUCCESS("Solutions imported"))
|
||||||
|
|
||||||
with open("import_olddb/syntheses.csv") as f:
|
with open("import_olddb/syntheses.csv") as f:
|
||||||
@ -274,5 +272,8 @@ class Command(BaseCommand):
|
|||||||
"uploaded_at": args[4],
|
"uploaded_at": args[4],
|
||||||
}
|
}
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
Synthesis.objects.create(**obj_dict)
|
try:
|
||||||
|
Synthesis.objects.create(**obj_dict)
|
||||||
|
except:
|
||||||
|
print("Synthesis exists")
|
||||||
self.stdout.write(self.style.SUCCESS("Syntheses imported"))
|
self.stdout.write(self.style.SUCCESS("Syntheses imported"))
|
||||||
|
Loading…
Reference in New Issue
Block a user