Commit 4d3b6587 by Tuomas Riihimäki

Fix eventuser creation when user logs in to new event..

1 parent 98e275cb
......@@ -483,11 +483,11 @@ public class PlaceBean implements PlaceBeanLocal {
@RolesAllowed(MapPermission.S_BUY_PLACES)
public Place unbuyPlace(Place place) {
place = placeFacade.reload(place);
if (place.getGroup() != null) {
place.getGroup().getPlaces().remove(place);
place.setGroup(null);
}
place.setGroup(null);
if (place.getPlaceReserver() != null)
{
......
......@@ -27,8 +27,6 @@ import fi.codecrew.moya.facade.callbacks.OrderCallback;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.EventUser_;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.PrintedCard;
import fi.codecrew.moya.model.PrintedCard_;
import fi.codecrew.moya.model.User;
import fi.codecrew.moya.model.User_;
import fi.codecrew.moya.util.UserSearchQuery;
......@@ -64,7 +62,8 @@ public class EventUserFacade extends IntegerPkGenericFacade<EventUser> {
event));
ret = getSingleNullableResult(getEm().createQuery(cq));
logincache.get(event.getId()).put(ret.getLogin(), ret.getId());
if (ret != null)
logincache.get(event.getId()).put(ret.getLogin(), ret.getId());
}
return ret;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!