Fix creating an info item for a team. Camp is on team, not info category.

This commit is contained in:
Víðir Valberg Guðmundsson 2019-03-12 09:56:27 +01:00
parent 0f18b5de5c
commit ed311fe2aa

View file

@ -37,7 +37,7 @@ class InfoItemCreateView(LoginRequiredMixin, CampViewMixin, TeamViewMixin, Ensur
def form_valid(self, form):
info_item = form.save(commit=False)
category = InfoCategory.objects.get(camp=self.camp, anchor=self.kwargs.get('category_anchor'))
category = InfoCategory.objects.get(team__camp=self.camp, anchor=self.kwargs.get('category_anchor'))
info_item.category = category
info_item.save()
return HttpResponseRedirect(self.get_success_url())