users: is_visible_to is False if v doesn't exist

this lets us use this function even with a logged out user
master
justcool393 2022-10-30 03:04:46 -05:00
parent d1e35e4afe
commit 5af772c1f9
1 changed files with 1 additions and 0 deletions

View File

@ -747,6 +747,7 @@ class User(Base):
@lazy
def is_visible_to(self, user) -> bool:
if not self.is_private: return True
if not user: return False
if self.id == user.id: return True
return user.admin_level >= PERMS['VIEW_PRIVATE_PROFILES'] or user.eye