|
|
|
|
@ -2171,6 +2171,25 @@ defer { |
|
|
|
|
//enableOnlineRegistration = true |
|
|
|
|
registrationDateLimit = deadline(for: .inscription) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//self.customizeUsingPreferences() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func customizeUsingPreferences() { |
|
|
|
|
guard let lastTournamentWithSameBuild = DataStore.shared.tournaments.filter({ tournament in |
|
|
|
|
tournament.tournamentLevel == self.tournamentLevel |
|
|
|
|
&& tournament.tournamentCategory == self.tournamentCategory |
|
|
|
|
&& tournament.federalTournamentAge == self.federalTournamentAge |
|
|
|
|
&& tournament.hasEnded() == true |
|
|
|
|
&& tournament.isCanceled == false |
|
|
|
|
&& tournament.isDeleted == false |
|
|
|
|
}).sorted(by: \.endDate!, order: .descending).first else { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
self.dayDuration = lastTournamentWithSameBuild.dayDuration |
|
|
|
|
self.teamCount = (lastTournamentWithSameBuild.teamCount / 2) * 2 |
|
|
|
|
self.enableOnlineRegistration = lastTournamentWithSameBuild.enableOnlineRegistration |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func onlineRegistrationCanBeEnabled() -> Bool { |
|
|
|
|
|