"No Conference found with key: " + websafeConferenceKey));
}
// Registration happens here.
Profile profile = getProfileFromUser(user, userId);
if (profile.getConferenceKeysToAttend().contains(websafeConferenceKey)) {
return new TxResult<>(new ConflictException("You have already registered for this conference"));
} else if (conference.getSeatsAvailable() <= 0) {
return new TxResult<>(new ConflictException("There are no seats available."));
} else {
profile.addToConferenceKeysToAttend(websafeConferenceKey);
conference.bookSeats(1);
ofy().save().entities(profile, conference).now();
return new TxResult<>(true);