Commit e0c3d5bf by Tuomas Riihimäki

Quefixes

1 parent da9d3e91
...@@ -120,7 +120,7 @@ public class QueueBean implements QueueBeanLocal { ...@@ -120,7 +120,7 @@ public class QueueBean implements QueueBeanLocal {
logger.info("Removed user {} from reserving queue", user); logger.info("Removed user {} from reserving queue", user);
} }
// There should neve be more than one instance, but make sure // There should neve be more than one instance, but make sure
while (!queue.remove(user)) { while (queue.remove(user)) {
logger.info("Removed user {} from queue"); logger.info("Removed user {} from queue");
} }
ret = queEntries.remove(user); ret = queEntries.remove(user);
...@@ -189,6 +189,10 @@ public class QueueBean implements QueueBeanLocal { ...@@ -189,6 +189,10 @@ public class QueueBean implements QueueBeanLocal {
// If queue is not enabled, user can always reserve // If queue is not enabled, user can always reserve
if (!isQueueEnabled()) if (!isQueueEnabled())
return true; return true;
if (map == null || user == null)
{
logger.warn("Can not check map {}, user {}", map, user);
}
boolean ret = getMapque(map).isReserving(user); boolean ret = getMapque(map).isReserving(user);
// Do some housekeeping, but only on each 120 // Do some housekeeping, but only on each 120
......
...@@ -139,7 +139,7 @@ public class AjaxMapView extends GenericCDIView { ...@@ -139,7 +139,7 @@ public class AjaxMapView extends GenericCDIView {
public boolean canUserBuy() { public boolean canUserBuy() {
return permbean.hasPermission(MapPermission.BUY_PLACES) && return permbean.hasPermission(MapPermission.BUY_PLACES) &&
(permbean.hasPermission(MapPermission.MANAGE_OTHERS) || (permbean.hasPermission(MapPermission.MANAGE_OTHERS) ||
quebean.isReserving(map, permbean.getCurrentUser()) quebean.isReserving(initMap(), permbean.getCurrentUser())
); );
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!