def delete_good(request):
"""deletes the good with data from request
"""
logger.debug('***delete good method starts ***')
good_id = request.params.get('id')
good = Good.query.filter_by(id=good_id).first()
if not good:
transaction.abort()
return Response('There is no good with id: %s' % good_id, 500)
good_name = good.name
try:
DBSession.delete(good)
transaction.commit()
except Exception as e:
transaction.abort()
c = StdErrToHTMLConverter(e)
transaction.abort()
return Response(c.html(), 500)
return Response('Successfully deleted good with name %s' % good_name)
评论列表
文章目录