mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 12:32:18 +01:00 
			
		
		
		
	Fix import
This commit is contained in:
		@@ -164,7 +164,6 @@ class Command(BaseCommand):
 | 
			
		||||
                    "is_staff": args[18] == "ADMIN",
 | 
			
		||||
                    "is_superuser": args[18] == "ADMIN",
 | 
			
		||||
                }
 | 
			
		||||
                print(obj_dict)
 | 
			
		||||
                with transaction.atomic():
 | 
			
		||||
                    TFJMUser.objects.create(**obj_dict)
 | 
			
		||||
        self.stdout.write(self.style.SUCCESS("Users imported"))
 | 
			
		||||
@@ -250,7 +249,6 @@ class Command(BaseCommand):
 | 
			
		||||
                        Solution.objects.create(**obj_dict)
 | 
			
		||||
                    except:
 | 
			
		||||
                        print("Solution exists")
 | 
			
		||||
                        continue
 | 
			
		||||
        self.stdout.write(self.style.SUCCESS("Solutions imported"))
 | 
			
		||||
 | 
			
		||||
        with open("import_olddb/syntheses.csv") as f:
 | 
			
		||||
@@ -274,5 +272,8 @@ class Command(BaseCommand):
 | 
			
		||||
                    "uploaded_at": args[4],
 | 
			
		||||
                }
 | 
			
		||||
                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"))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user