Open debarone opened 1 month ago
The async_sender.api.SenderError
happens because the async_sender.api.Message
seems to be initialised twice by the code at sanic_beskar/base.py; once at Line 1802 and the second time at Line 1811
async_sender
library(this was done in my virtualenv) below is the diff
11a12,14
> import logging
> logging.basicConfig(level=logging.DEBUG)
> logger = logging.getLogger(__name__)
167a171
> logger.debug(f"Initiliasation: {self.message_id} - {(self.to, self.cc, self.bcc)}")
174a179
> logger.debug(f"Validation: {self.message_id} - {(self.to, self.cc, self.bcc)}")
poetry run python example/register.py
curl localhost:8000/register -X POST -d '{"username": "Sidius", "password": "str0ng_p4ssw0rd", "email": "sidius@gc.com"}' | jq '.'
Message
instances during initialisation and validation are different. And the one during validation does not have the to
, cc
or bcc
attributes
Error Running Registration Example
A
sanic_beskar.exceptions.BeskarError
(from an initialasync_sender.api.SenderError
) is raised when registering a new user on the/register
endpoint of theexample\register.py
example with the following details: SenderError: Does not specify any recipients(to,cc,bcc) (401).Your environment
Steps to reproduce
.python-version
filepoetry run python example/register.py
/register
endpoint with curlExpected behaviour
A JSON response below should be returned with a status code of 200.
Actual behaviour
Instead a
sanic_beskar.exceptions.BeskarError
is raised, returning JSON response with a status code of 401 as shown below.