Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

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

Merged
merged 2 commits into from
Jul 18, 2016

Conversation

Half-Shot
Copy link
Collaborator

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'.

@matrixbot
Copy link
Member

Can one of the admins verify this patch?

4 similar comments
@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@erikjohnston
Copy link
Member

ok to test

@@ -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"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@Half-Shot Half-Shot force-pushed the develop branch 2 times, most recently from d31412f to 60656ae Compare July 16, 2016 17:43
@erikjohnston
Copy link
Member

LGTM.

Can you sign off the commit?

@Half-Shot
Copy link
Collaborator Author

Signed-off-by: Will Hunt [email protected]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants