Skip to content

Commit

Permalink
First pass at site endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lullis committed Feb 1, 2024
1 parent 4bdf535 commit b7173a6
Show file tree
Hide file tree
Showing 3 changed files with 292 additions and 290 deletions.
6 changes: 5 additions & 1 deletion lemmy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from users.models import Domain, Identity

from . import choices
from . import choices, types


class Instance(Domain):
Expand Down Expand Up @@ -34,6 +34,10 @@ class Person(Identity):
bot_account = models.BooleanField(default=False)
ban_expires = models.DateTimeField(blank=True, null=True)

@property
def instance_id(self) -> types.InstanceId:
return types.InstanceId(hash(str(self.domain)))

@property
def is_deleted(self) -> bool:
return self.deleted is not None
Expand Down
Loading

0 comments on commit b7173a6

Please sign in to comment.