Skip to content

Commit

Permalink
Removed system user api
Browse files Browse the repository at this point in the history
  • Loading branch information
kirgrim committed Mar 9, 2024
1 parent cbac685 commit ca5c6cd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
1 change: 0 additions & 1 deletion utils/database_utils/mongo_utils/queries/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class UserPatterns(Enum):
"avatar": "neon.webp",
}
GUEST_NANO = {"first_name": "Nano", "last_name": "Guest", "tokens": []}
SYSTEM = {"nickname": "system", "first_name": "System", "last_name": "User"}


class ConversationSkins:
Expand Down
13 changes: 0 additions & 13 deletions utils/database_utils/mongo_utils/queries/dao/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,3 @@ def create_guest(self, nano_token: str = None) -> dict:
# https://www.mongodb.com/docs/manual/core/index-ttl/
self.add_item(data=new_user)
return new_user

def get_system_user(self) -> dict:
system_user = self.get_user(nickname="system")
if not system_user:
system_user = self._register_system_user()
return system_user

def _register_system_user(self):
user_data = self.create_from_pattern(
source=UserPatterns.SYSTEM,
)
self.add_item(data=user_data)
return user_data

0 comments on commit ca5c6cd

Please sign in to comment.