diff --git a/src/main/webapp/WEB-INF/groovy/store.groovy b/src/main/webapp/WEB-INF/groovy/store.groovy index 564a121..22ccbc3 100644 --- a/src/main/webapp/WEB-INF/groovy/store.groovy +++ b/src/main/webapp/WEB-INF/groovy/store.groovy @@ -20,8 +20,8 @@ if (githubAuthUtil.isAuthenticated()) { uploader: username, uploaderEmail: session.getAttribute(GithubAuthUtil.GITHUB_EMAIL_PRIMARY) ) + UserList myList = LgtmService.instance.getUserList(username) try { - UserList myList = LgtmService.instance.getUserList(username) if (myList.bannedFromUpload) { request.setAttribute 'message', "You're not allowed to upload images" @@ -46,6 +46,7 @@ if (githubAuthUtil.isAuthenticated()) { request.setAttribute 'message', 'That image was already uploaded.' redirect "/i/${e.hash}" } catch (ValidationException e) { + request.setAttribute('banned', myList.bannedFromUpload) request.setAttribute 'message', e.message request.setAttribute 'imageUrl', imageUrl response.setHeader "Content-Type", "text/html" diff --git a/src/main/webapp/WEB-INF/pages/upload.gtpl b/src/main/webapp/WEB-INF/pages/upload.gtpl index 0caf355..2dfc610 100644 --- a/src/main/webapp/WEB-INF/pages/upload.gtpl +++ b/src/main/webapp/WEB-INF/pages/upload.gtpl @@ -5,7 +5,11 @@

Upload

- <% if (request.getAttribute('banned') == false) { %> + <% if (request.getAttribute('banned') == true) { %> + + <% } else { %>
Image Url @@ -17,10 +21,6 @@
- <% } else { %> - <% } %> \ No newline at end of file