def noticia_novo(request):
    """
      @noticia_novo: Metodo de criação de um novo Problema
    """
    if request.method == "POST":
        form = NoticiaForm(request.POST)
        if form.is_valid():
            noticia = form.save(commit=False)
            noticia.save()

            return HttpResponseRedirect(r("noticia:noticias"))
        else:
            return render(request, "noticia_form.html", {"form": form, "status": "Novo"})
    else:
        return render(request, "noticia_form.html", {"form": NoticiaForm(), "status": "Novo"})
def noticia_editar(request, id_noticia):
    """
      @noticia_editar: Metodo de edição de um noticia cadastrado na base
    """
    noticia = Noticia.objects.get(id=id_noticia)

    if request.method == "POST":
        form = NoticiaForm(request.POST, instance=noticia)
        if form.is_valid():
            noticia = form.save(commit=False)
            noticia.save()

            return HttpResponseRedirect(r("noticia:noticias"))
        else:
            return render(request, "noticia_form.html", {"form": form, "id_noticia": id_noticia, "status": "Editar"})
    else:
        return render(
            request,
            "noticia_form.html",
            {"form": NoticiaForm(instance=noticia), "id_noticia": id_noticia, "status": "Editar"},
        )