Skip to Content
Menu
This question has been flagged
1994 Views

class WebsiteSignage(http.Controller):
    # DELETE POST
    # /[project]/admin/post/{menuId.id}/{post.id}/delete
    @http.route(['/signage/admin/post/<model("signage.signage"):signage>/<model("signage.area.page"):page>/delete'],type='http', auth='user', website=True)
    def delete_postId (self, signage, page):
        page.unlink()
        return werkzeug.utils.redirect('/signage/admin/menu/%s/edit' % signage.id)
       
    # DELETE AREA
    # /[project]/admin/submenu/{submenu.id}/delete
    @http.route(['/signage/admin/submenu/<model("signage.area"):area>/delete'],type='http', auth='user', website=True)
    def delete_postId (self, area):
        area.unlink()
        return werkzeug.utils.redirect('/signage/' )

    # DELETE [PROJECT] // SHOWCASE
    # /[project]/admin/menu/{menu.id}/delete
    @http.route(['/signage/admin/menu/<model("signage"):signage>/delete'],type='http', auth='user', website=True)
    def delete_postId (self, signage):
        _logger.warn('<<<<<<<<<<<<<<<<<  signage = %s' % signage)
        signage.unlink()
        return werkzeug.utils.redirect('/signage/' )

Why is the third "unlink" not working? The first and second "unlink" is  working!

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 23
3493
2
Mar 23
1151
1
Dec 22
4016
2
Aug 21
3589
1
Aug 20
2476