我遇到以下错误:
UnboundLocalError:之前引用的本地变量'team_members' 作业
默认情况下,模型中的塞子值为1。
这是功能:
def single_slug(request, single_slug):
team = [c.infraTeam_slug for c in infraTeam.objects.all()]
if single_slug in team:
team_members = TeamMember.objects.filter(infra_team__infraTeam_slug=single_slug)
series_urls = {}
for m in team_members.all():
part_one = vulnerability.objects.filter(member_name__member_name=m.member_name).earliest("vulnerabilty_date")
series_urls[m] = part_one.vulnerability_slug
return render(request=request,
template_name='main/category.html',
context={"member_name": team_members, "part_ones": series_urls})
请帮助我解决这个问题。