Fix None bug

This commit is contained in:
cuom1999 2024-04-23 15:53:58 -05:00
parent ba96d83db8
commit e24c208e1d

View file

@ -187,10 +187,12 @@ class PostView(TitleMixin, CommentedDetailView, PageVoteDetailView, BookMarkDeta
context["editable_orgs"] = [] context["editable_orgs"] = []
can_edit = False can_edit = False
orgs = list(self.object.organizations.all())
if self.request.profile:
if self.request.profile.id in self.object.get_authors(): if self.request.profile.id in self.object.get_authors():
can_edit = True can_edit = True
orgs = list(self.object.organizations.all())
for org in orgs: for org in orgs:
if org.is_admin(self.request.profile): if org.is_admin(self.request.profile):
can_edit = True can_edit = True