AssertionError - 没有提供异常 - django

 mobiledu2502898473 发布于 2023-01-31 12:33

我真的很困惑,不知道它对我有什么要求.

这是我的简单功能

def confirm_abo(request):
  try:
      abo = Abonnement.objects.get(id=int(request.GET.get('abocid')))
      abo.status = 1
      abo.save()
      link = "http://127.0.0.1:8000/delete_link/?abocid=" + str(abo.id)
      subject = "test subject"
      message = "test message" + link
      send_mail(subject, message, 'info@test.com', [abo.email], fail_silently=False)
      return render(request,'abo_confirm.html',{'abo':abo,'abo_success':'yes'})
  except: 
      return render(request,'abo_confirm.html',{'abo_success':''})#<-- problem

我正在进入最后一行

AssertionError at /confirm_abo/ No exception supplied

错误.

我在django1.4和python 2.7.它一直工作到现在没有任何问题..

我究竟做错了什么?

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有