Fix None bug

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

View file

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