Author: tchemit Date: 2012-09-04 18:32:29 +0200 (Tue, 04 Sep 2012) New Revision: 3676 Url: http://chorem.org/repositories/revision/pollen/3676 Log: fix delete vote (accountId not remove from url if creator on free poll...) Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteVote.java Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteVote.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteVote.java 2012-09-04 16:17:33 UTC (rev 3675) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/DeleteVote.java 2012-09-04 16:32:29 UTC (rev 3676) @@ -71,12 +71,18 @@ addFlashMessage(_("pollen.information.vote.deleted")); - if (poll.isPollFree() && - getUserSecurityContext().isWithAccountId() && - !getUserSecurityContext().isCreator()) { + if (poll.isPollFree() && getUserSecurityContext().isWithAccountId()){ - // remove accountId from url, voter does no longer exists. - getPollUri().setAccountId(null); + // must remove accountId from url if not creator accountId + + String userAccountId = getUserSecurityContext().getAccountId(); + String creatorId = getUserSecurityContext().getPoll().getCreator().getAccountId(); + + if (!creatorId.equals(userAccountId)) { + + // remove accountId from url, the accountId does no longer exists. + getPollUri().setAccountId(null); + } } return SUCCESS; }