Allow amateur performer profiles

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-11-08 02:29:09 +00:00
commit 0728d2a3f7
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
20 changed files with 217 additions and 29 deletions

View file

@ -608,6 +608,7 @@ namespace Yavsc.Controllers
var uid = user.Id;
var postedCountryCode = model.ExerciseCountryCode;
model.ExerciseCountryCode = NormalizeCountryCodeOrDefault(model.ExerciseCountryCode);
model.SIREN = model.SIREN?.Trim() ?? string.Empty;
// Model binding validated the raw posted payload before entering
// the action. If country was empty, we fallback to "fr" above,
@ -622,7 +623,7 @@ namespace Yavsc.Controllers
if (ModelState.IsValid)
{
var isFrenchPerformerCode = string.Equals(model.ExerciseCountryCode, "fr", StringComparison.Ordinal);
if (isFrenchPerformerCode)
if (isFrenchPerformerCode && !string.IsNullOrWhiteSpace(model.SIREN))
{
var exSiren = await _dbContext.ExceptionsSIREN.FirstOrDefaultAsync(
ex => ex.SIREN == model.SIREN