Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HasIndividualRegistration #897

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

asyasky
Copy link
Collaborator

@asyasky asyasky commented Aug 22, 2023

Add concept of HasIndividualRegistration to Event object and adjust navigation flow based on it. Events that have individual registration will push players through that registration flow, events that don't will go back to the old flow of going directly to join/create team. This should also fix the previous event access bug.

@asyasky asyasky requested a review from morganbr August 22, 2023 03:13
return await dbContext.PlayerInEvent.Where(p => p.PlayerId == ID && p.EventId == thisEvent.ID).AnyAsync();
}

return await dbContext.TeamMembers.Where(tm => tm.Member.ID == ID && tm.Team.Event.ID == thisEvent.ID).AnyAsync();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit]: Can technically do .AnyAsync(tm => tm.Member.ID == ID ...) instead of the Where clause

@@ -32,7 +32,7 @@ public async Task<IActionResult> OnGetAsync()
return Challenge();
}

if (!(await LoggedInUser.IsRegisteredForEvent(_context, Event)))
if (Event.HasIndividualRegistration && !(await LoggedInUser.IsRegisteredForEvent(_context, Event)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does a similar check need to happen in Team/Apply.cs?
image

Right now, it looks like if the player is not registered, they won't be able to apply for a team and will get redirected to register as a player

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants