| Commit message (Collapse) | Author | Lines |
|
Incident author and the moderator who actioned report are now passed
through `make_username` to create the webhook username.
Tests adjusted as appropriate.
|
|
The justification is to incorporate the `actioned_by` name into the
username in some way, and so the logical thing to do is to abstract
this process into a helper so that it can easily be adjusted in the
future. For now, I've chosen to separate the names by a pipe.
Discord webhook username cannot exceed 80 characters in length, and
so we cap it at this length by default. This is seen as more of an
edge-case, but it should be accounted for, as we're not joining two
names. The `max_length` param is configurable primarily for testing
purposes, it probably should never be passed explicitly.
This commit also provides two tests for the function.
|
|
See: a8b4e394d9da57287cd9497cd9bb0a97fa467e84
|
|
With PR #1009 merged, we now apply the same fix to our relay function.
This prevents the "clyde" word from sneaking into the webhook username,
which is forbidden and will return a 400.
|
|
This is already being patched at class-level.
|
|
Suggested by Mark during review. This follows the "ask for forgiveness
rather than permission" paradigm, ends up being less code to read, and
may be seen as more logical / safer.
The `ALLOWED_EMOJI` set was renamed to `ALL_SIGNALS` as this now better
communicates the set's purpose.
Tests adjusted as appropriate.
Co-authored-by: MarkKoz <[email protected]>
|
|
Using `issubset` is a much simpler & more readable way of expressing
the relationship between the two sets.
Suggested by Mark during review.
Co-authored-by: MarkKoz <[email protected]>
|
|
Requested during review.
Co-authored-by: ks129 <[email protected]>
Co-authored-by: Joseph Banks <[email protected]>
|
|
Suggested by Mark during review.
Co-authored-by: MarkKoz <[email protected]>
|
|
Pointed out by Mark during review that this is unnecessary, as logging
using `exception` automatically appends the `exc_info` of the handled
exception when done in an except block.
Co-authored-by: MarkKoz <[email protected]>
|