check if user exists
This commit is contained in:
@@ -33,6 +33,9 @@ class CNPJConflictError(ConflictError): ...
|
|||||||
class EmailConflictError(ConflictError): ...
|
class EmailConflictError(ConflictError): ...
|
||||||
|
|
||||||
|
|
||||||
|
class UserNotFoundError(NotFoundError): ...
|
||||||
|
|
||||||
|
|
||||||
class EmailNotFoundError(NotFoundError): ...
|
class EmailNotFoundError(NotFoundError): ...
|
||||||
|
|
||||||
|
|
||||||
@@ -124,6 +127,11 @@ def add_org(
|
|||||||
'created_at': now_,
|
'created_at': now_,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
transact.condition(
|
||||||
|
key=KeyPair(str(user.id), '0'),
|
||||||
|
cond_expr='attribute_exists(sk)',
|
||||||
|
exc_cls=UserNotFoundError,
|
||||||
|
)
|
||||||
transact.condition(
|
transact.condition(
|
||||||
# Post-migration (users): rename `email` to `EMAIL`
|
# Post-migration (users): rename `email` to `EMAIL`
|
||||||
key=KeyPair('email', user.email),
|
key=KeyPair('email', user.email),
|
||||||
|
|||||||
Reference in New Issue
Block a user