Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fall back to 'username' if 'user' is not given for appservice registration. #927

Merged
merged 2 commits into from Jul 18, 2016

Conversation

Projects
None yet
3 participants
Contributor

Half-Shot commented Jul 16, 2016

It's stated in the comments that (quite sensibly) we should fallback to 'username' if user isn't given, yet this didn't appear to be implemented. This allows for either key with a preference for 'user'.

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Owner

erikjohnston commented Jul 16, 2016

ok to test

@erikjohnston erikjohnston and 1 other commented on an outdated diff Jul 16, 2016

synapse/rest/client/v2_alpha/register.py
@@ -134,9 +134,11 @@ def on_POST(self, request):
# fallback to 'username' if they gave one.
if isinstance(body.get("user"), basestring):
desired_username = body["user"]
@erikjohnston

erikjohnston Jul 16, 2016

Owner

would be sorely tempted to change this line to:

desired_username = body.get("user", desired_username)

As all the isinstance(..., basestring) is making me sad

@Half-Shot

Half-Shot Jul 16, 2016

Contributor

Sounds good.

Half-Shot added some commits Jul 16, 2016

Owner

erikjohnston commented Jul 18, 2016

LGTM.

Can you sign off the commit?

Contributor

Half-Shot commented Jul 18, 2016

Signed-off-by: Will Hunt half-shot@molrams.com

@erikjohnston erikjohnston merged commit 4f81edb into matrix-org:develop Jul 18, 2016

5 checks passed

Flake8 + Packaging (Merged PR) Build finished.
Details
Sytest Dendron (Merged PR) Build finished.
Details
Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Merged PR) Build finished.
Details
Unit Tests (Merged PR) Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment