mirror of
				https://gitlab.crans.org/bde/nk20-scripts
				synced 2025-11-04 08:32:10 +01:00 
			
		
		
		
	Import note balance of BDE and special notes
This commit is contained in:
		@@ -67,6 +67,12 @@ class Command(ImportCommand):
 | 
				
			|||||||
        for row in cur:
 | 
					        for row in cur:
 | 
				
			||||||
            MAP_IDBDE_PROMOTION[row["idbde"]] = row
 | 
					            MAP_IDBDE_PROMOTION[row["idbde"]] = row
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        cur.execute("SELECT * FROM comptes WHERE idbde <= 0 ORDER BY idbde;")
 | 
				
			||||||
 | 
					        for row in cur:
 | 
				
			||||||
 | 
					            note = Note.objects.get(pk=MAP_IDBDE[row["idbde"]])
 | 
				
			||||||
 | 
					            note.balance = row["solde"]
 | 
				
			||||||
 | 
					            note.save()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        cur.execute("SELECT * FROM comptes WHERE idbde > 0 ORDER BY idbde;")
 | 
					        cur.execute("SELECT * FROM comptes WHERE idbde > 0 ORDER BY idbde;")
 | 
				
			||||||
        pk_club = 3
 | 
					        pk_club = 3
 | 
				
			||||||
        pk_user = 1
 | 
					        pk_user = 1
 | 
				
			||||||
@@ -114,6 +120,7 @@ class Command(ImportCommand):
 | 
				
			|||||||
                    "last_name": row["nom"],
 | 
					                    "last_name": row["nom"],
 | 
				
			||||||
                    "email": row["mail"],
 | 
					                    "email": row["mail"],
 | 
				
			||||||
                    "is_active": True,  # temporary
 | 
					                    "is_active": True,  # temporary
 | 
				
			||||||
 | 
					                    "date_joined": make_aware(MAP_IDBDE_PROMOTION[row["idbde"]]["created_at"]),
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                profile_dict = {
 | 
					                profile_dict = {
 | 
				
			||||||
                    "pk": pk_profile,
 | 
					                    "pk": pk_profile,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user