Skip to content

Commit

Permalink
- (Event) Fixed issue in Obsidian RegistrationEntry where a full even…
Browse files Browse the repository at this point in the history
…t would display the wait list message when making edits or completing a registration after moving off the wait list.
  • Loading branch information
ethan-sparkdevnetwork committed May 16, 2023
1 parent 406a959 commit cfe0874
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Rock.Blocks/Event/RegistrationEntry.cs
Expand Up @@ -2646,6 +2646,9 @@ RegistrationGuid argument.
var startAtBeginning = !isExistingRegistration ||
( allowExternalRegistrationUpdates && PageParameter( PageParameterKey.StartAtBeginning ).AsBoolean() );

// Adjust the spots remaining if this is an existing registration. Add to the Spots remaining the number of registrants that are not on the waitlist.
var adjustedSpotsRemaining = isExistingRegistration ? context.SpotsRemaining + session.Registrants.Where( r => r.IsOnWaitList == false ).Count() : context.SpotsRemaining;

var viewModel = new RegistrationEntryBlockViewModel
{
RegistrationAttributesStart = beforeAttributes,
Expand All @@ -2671,7 +2674,7 @@ RegistrationGuid argument.
Settings = financialGatewayComponent?.GetObsidianControlSettings( financialGateway, null ) ?? new object()
},
IsRedirectGateway = isRedirectGateway,
SpotsRemaining = context.SpotsRemaining,
SpotsRemaining = adjustedSpotsRemaining,
WaitListEnabled = context.RegistrationSettings.IsWaitListEnabled,
InstanceName = context.RegistrationSettings.Name,
PluralRegistrationTerm = pluralRegistrationTerm,
Expand Down

0 comments on commit cfe0874

Please sign in to comment.