Skip to content
Snippets Groups Projects
Commit aaaf170b authored by Daniel Vitor Ruiz's avatar Daniel Vitor Ruiz
Browse files

Fix ProgramaSearch problem of inheriting tematicas of a unfinished programa

parent d5ea53d4
No related branches found
No related tags found
No related merge requests found
......@@ -280,6 +280,7 @@ public class ProgramaController {
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
uiModel.addAttribute("create", true);
Programa programa = Programa.findPrograma(id);
addDateTimeFormatPatterns(uiModel);
......@@ -462,11 +463,16 @@ public class ProgramaController {
@RequestMapping(value = "pesquisa", method = RequestMethod.GET)
public String searchProgramas(@Valid Programa programa, Model uiModel) {
//if((Boolean)uiModel.asMap().get("create")){
// programa = new Programa();
// uiModel.addAttribute("programa", new Programa());
// uiModel.addAttribute("create", false);
//}
if(!uiModel.asMap().containsKey("create")){
uiModel.addAttribute("create", false);
}
if((Boolean)uiModel.asMap().get("create")){
programa = new Programa();
uiModel.addAttribute("programa", new Programa());
uiModel.addAttribute("create", false);
}
uiModel.addAttribute("tematicas", programa.getTematicas());
if (programa.getNomeOficial() != null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment