Skip to content

Commit

Permalink
added default tag for new questions, closes #143
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Dec 20, 2019
1 parent 4380c73 commit c9bfd1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -183,6 +183,8 @@ para.max_comments_per_id = 1000
para.max_comment_length = 255
# Post body limit (characters)
para.max_post_length = 20000
# Sets the default tag for new questions
para.default_question_tag = "question"
```

On startup, Scoold will try to connect to Para 10 times, with a 10 second interval between retries. After that it will
Expand Down
Expand Up @@ -154,9 +154,12 @@ public String post(@RequestParam(required = false) String location, @RequestPara
String currentSpace = utils.getValidSpaceIdExcludingAll(authUser, null, req);
boolean needsApproval = utils.postNeedsApproval(authUser);
Question q = utils.populate(req, needsApproval ? new UnapprovedQuestion() : new Question(),
"title", "body", "tags|,", "location");
"title", "body", "location");
q.setCreatorid(authUser.getId());
q.setSpace(currentSpace);
if (StringUtils.isBlank(req.getParameter("tags"))) {
q.setTags(Arrays.asList(Config.getConfigParam("default_question_tag", "question")));
}
Map<String, String> error = utils.validate(q);
if (error.isEmpty()) {
q.setLocation(location);
Expand Down

0 comments on commit c9bfd1a

Please sign in to comment.