User Changed webhook: add 'nickname' and 'old_nickname' #93582

Merged
Sybren A. Stüvel merged 2 commits from webhook/gitea-username into main 2023-05-01 15:38:14 +02:00

2 Commits

Author SHA1 Message Date
6ca096c4c8 User Changed webhook: add 'nickname' and 'old_nickname'
Monitor users' nicknames, send out a 'user changed' webhook when it
changes, and include the nickname in the webhook payload.

This also adds an `old_nickname` field to the 'user changed' webhook
payload. This is necessary for the Gitea user renaming logic. Since
Blender ID is more lenient with allowed characters, the username on
Gitea and the nickname on Blender ID will not exactly match. To detect
whether a rename of the Gitea user is actually required, the webhook
needs to know whether the Blender ID nickname actually changed or not.
2023-05-01 15:09:46 +02:00
3c6ba65e7b Refactor: simplify 'user changed' webhook payload construction
Instead of ternary `if`/`else` expression, use a small function.

No functional changes.
2023-05-01 12:56:29 +02:00