From b68a7e5513a0e4d90470b764a8d8a4d33972af19 Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 16 May 2024 11:48:09 +0200 Subject: [PATCH] Minor improvements --- PadelClub/Data/DataStore.swift | 6 +----- PadelClub/Data/README.md | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/PadelClub/Data/DataStore.swift b/PadelClub/Data/DataStore.swift index a5927fb..b6ea365 100644 --- a/PadelClub/Data/DataStore.swift +++ b/PadelClub/Data/DataStore.swift @@ -59,8 +59,6 @@ class DataStore: ObservableObject { store.synchronizationApiURL = "https://xlr.alwaysdata.net/api/" var synchronized : Bool = true - self.user = User.placeHolder() // force the didSet - #if DEBUG if let server = PListReader.readString(plist: "local", key: "server") { store.synchronizationApiURL = server @@ -109,9 +107,7 @@ class DataStore: ObservableObject { @objc func collectionDidLoad(notification: Notification) { self.objectWillChange.send() if let userSingleton: StoredSingleton = notification.object as? StoredSingleton { - Logger.log("StoredObject loaded with user = \(String(describing: userSingleton.item()))") - - self.user = userSingleton.item() ?? User.placeHolder() + self.user = userSingleton.item() ?? self._temporaryLocalUser.item ?? User.placeHolder() } else if let clubsCollection: StoredCollection = notification.object as? StoredCollection { self._fixMissingClubCreatorIfNecessary(clubsCollection) } else if let eventsCollection: StoredCollection = notification.object as? StoredCollection { diff --git a/PadelClub/Data/README.md b/PadelClub/Data/README.md index 4233a87..1f51cd5 100644 --- a/PadelClub/Data/README.md +++ b/PadelClub/Data/README.md @@ -11,7 +11,7 @@ Dans Django: - Ajouter le champ dans la classe - S'il c'est un champ dans **CustomUser**: - Ajouter le champ à la méthode fields_for_update - - s’assurer que ca casse pas la creation de user dans serializers.py + - Ajouter le champ dans UserSerializer > create > create_user dans serializers.py - Faire le *makemigrations* + *migrate*