Exemplo n.º 1
0
def delete_category(id):
    category = Category()
    if (category.is_exist(id) != True):
        flash('Sorry,That category doesn\'t exist', category='errorMessage')
        return redirect(redirect_back())
    delete_category = category.delete(id)
    if (delete_category):
        flash(' Category has been successfully deleted',
              category='successMessage')
        return redirect(redirect_back())
    flash('Unable to save category', category='errorMessage')
    flash(request.form, category='input')
    return redirect(redirect_back())
Exemplo n.º 2
0
 def delete(self, id: int):
     return "success" if Category.delete(id=id) else api.abort(404)