Skip to content

Commit

Permalink
fixup! api: Update project export APIs - issue
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Jun 29, 2017
1 parent 73eb039 commit 4a1268a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/controllers/AttachmentApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ public class AttachmentApp extends Controller {
.getMilliseconds("application.temporaryfiles.keep-up.time", 24 * 60 * 60 * 1000L);

private static User findUploader(Map<String,String[]> formUrlEncoded) {
if(formUrlEncoded == null) {
if(formUrlEncoded == null || formUrlEncoded.isEmpty()) {
return UserApp.currentUser();
}
String authorEmail = HttpUtil.getFirstValueFromQuery(formUrlEncoded, "authorEmail");
User found = User.findByEmail(authorEmail);
if(found.isAnonymous()){
String authorLoginId = HttpUtil.getFirstValueFromQuery(formUrlEncoded, "authorLoginId");
return User.findByLoginId(authorLoginId);
User fallbackSearch = User.findByLoginId(authorLoginId);
if( fallbackSearch.isAnonymous() ) {
return UserApp.currentUser();
} else {
return fallbackSearch;
}
}
return found;
}
Expand Down

0 comments on commit 4a1268a

Please sign in to comment.