flake8
-
reviewboard/notifications/tests.py (Diff revision 1) -
reviewboard/webapi/models.py (Diff revision 1) F401 'reviewboard.webapi.signals.webapi_token_created' imported but unused
Review Request #9258 — Created Oct. 10, 2017 and submitted
Currently when a WebAPI token is created, we always send an e-mail
notifying the user of its creation. However, this is not always ideal.
Some extensions and/or integrations require a WebAPI token in order to
communicate with Review Board from some external service (such as
CircleCI). In this case, we do not need to bother the user with a
notification that the token was created.Djblets now has support for token update and create signals (via
/r/9275). We use these signals to determine if the token generated was
auto-generated. The notifications module has been modified to listen
to the new signals (instead of the genericpost_save
signal it was
listening to before) and not send e-mails when the token in question
is auto-generated.
Ran unit tests.
Description | From | Last Updated |
---|---|---|
F841 local variable 'webapi_token' is assigned to but never used |
reviewbot | |
F401 'reviewboard.webapi.signals.webapi_token_created' imported but unused |
reviewbot | |
At this point it might be nice to turn this into a table with signal, handler, sender and then iterate … |
david | |
We could just have a signal for this in djblets. It's definitely possible that other consumers of djblets.webapi will have … |
david | |
F401 'reviewboard.webapi.managers.WebAPITokenManager' imported but unused |
reviewbot | |
F401 'reviewboard.webapi.signals.webapi_token_updated' imported but unused |
reviewbot | |
Maybe a list of tuples? |
david | |
This docstring needs to be updated now. |
david | |
The outbox should default to [] at the beginning of every test. I think you can get rid of this … |
david | |
I think other things assertEqual(len(mail.outbox), 0) |
david | |
This can fit on one line. |
chipx86 | |
"WebAPIToken" |
chipx86 |
reviewboard/notifications/tests.py (Diff revision 1) |
---|
reviewboard/webapi/models.py (Diff revision 1) |
---|
F401 'reviewboard.webapi.signals.webapi_token_created' imported but unused
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+149 -14) |
reviewboard/notifications/email/__init__.py (Diff revision 2) |
---|
At this point it might be nice to turn this into a table with
signal, handler, sender
and then iterate that to do all the connections.
reviewboard/webapi/managers.py (Diff revision 2) |
---|
We could just have a signal for this in djblets. It's definitely possible that other consumers of djblets.webapi will have similar wants.
Use a table of signals and loop through it
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+156 -23) |
Move signals into /r/9275/
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 4 (+56 -23) |
reviewboard/webapi/models.py (Diff revision 4) |
---|
F401 'reviewboard.webapi.managers.WebAPITokenManager' imported but unused
reviewboard/webapi/models.py (Diff revision 4) |
---|
F401 'reviewboard.webapi.signals.webapi_token_updated' imported but unused
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+54 -23) |
reviewboard/notifications/tests.py (Diff revision 5) |
---|
The outbox should default to
[]
at the beginning of every test. I think you can get rid of this line.
reviewboard/notifications/tests.py (Diff revision 5) |
---|
I think other things
assertEqual(len(mail.outbox), 0)
Addressed David's issues
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+53 -23) |
Addressed Christian's issues
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+52 -23) |