Skip to content

Commit

Permalink
Remove User.id
Browse files Browse the repository at this point in the history
Now that all users are created by the create_user factory, it was easy
to do.
  • Loading branch information
bloodearnest committed Mar 14, 2024
1 parent 925d5b8 commit 5cd90a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions airlock/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class User:
is a convenience for passing that information around.
"""

id: int
username: str
workspaces: dict = dataclasses.field(default_factory=dict)
output_checker: bool = dataclasses.field(default=False)
Expand All @@ -24,11 +23,10 @@ def from_session(cls, session_data):
return
workspaces = user.get("workspaces", dict())
output_checker = user.get("output_checker", False)
return cls(user["id"], user["username"], workspaces, output_checker)
return cls(user["username"], workspaces, output_checker)

def to_dict(self):
return {
"id": self.id,
"username": self.username,
"workspaces": self.workspaces,
"output_checker": self.output_checker,
Expand Down
2 changes: 1 addition & 1 deletion tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def create_user(username="testuser", workspaces=None, output_checker=False):
workspaces_dict = {
workspace: {"project": "project"} for workspace in workspaces
}
return User(1, username, workspaces_dict, output_checker)
return User(username, workspaces_dict, output_checker)


def ensure_workspace(workspace_or_name):
Expand Down

0 comments on commit 5cd90a4

Please sign in to comment.