Skip to content

Commit

Permalink
Models/server: Fetch builds belonging to same server
Browse files Browse the repository at this point in the history
Signed-off-by: ZorEl212 <[email protected]>
  • Loading branch information
ZorEl212 committed Oct 26, 2024
1 parent 64ead01 commit 807782a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion models/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ class Server(BaseModel):
userId = ""
serverName = ""
ipAddress = ""
server_users = set()

@property
def availableBuilds(self):
pass
from models import storage
return storage.all('Build', 'server_id', self.id)

def add_user(self, userId):
if userId not in self.server_users:
self.server_users.add(userId)
return True
return False

0 comments on commit 807782a

Please sign in to comment.