Skip to content

Commit

Permalink
fix uniqueness check on users
Browse files Browse the repository at this point in the history
  • Loading branch information
chennisden committed Jun 12, 2024
1 parent 96f321f commit 3bbae6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion store/app/crud/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class UserCrud(BaseCrud):
async def add_user(self, user: User) -> None:
# Then, add the user object to the Users table.
table = await self.db.Table("Users")
await table.put_item(Item=user.model_dump(), ConditionExpression="attribute_not_exists(user_id)")
await table.put_item(Item=user.model_dump(), ConditionExpression="attribute_not_exists(email) AND attribute_not_exists(username)")

async def get_user(self, user_id: str) -> User | None:
table = await self.db.Table("Users")
Expand Down

0 comments on commit 3bbae6a

Please sign in to comment.