Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Add ability to disconnect elsewhere accounts. #1976

Merged
merged 13 commits into from Feb 28, 2014
Merged

Conversation

zwn
Copy link
Contributor

@zwn zwn commented Feb 2, 2014

I have separated elsewhere accounts into 'login' and the rest and I try to make sure there stays at least one login account. The UI is a bit simplistic but it is the best I could do - I am no UI person 馃槗. Please review.

Fix #639.

@zwn zwn mentioned this pull request Feb 7, 2014
This was referenced Feb 19, 2014
@seanlinsley
Copy link
Contributor

This is blocked by #2047, where the new version of Aspen changes how JSON error messages are served.

@chadwhitacre
Copy link
Contributor

@zwn Want to merge elsewhere into this? That will make it easier to merge this to master, since we're going to land #1369 first.

Conflicts:
	gittip/elsewhere/__init__.py
	gittip/models/_mixin_elsewhere.py
	templates/connected-accounts.html
	tests/test_elsewhere.py
	tests/test_participant.py
@Changaco
Copy link
Contributor

I have merged master into this, and made a style change (the old style was broken).

@Changaco
Copy link
Contributor

Error messages are now working. I think this PR is ready.

data = dict(platform=platform, user_id=user_id)
response = self.client.PxST('/alice/elsewhere.json', data, auth_as='alice')
assert response.code == 400
assert "last login" in response.body
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be better to test for the full error message

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we raise a subclass of Response instead of an instance of Response? Then we could use pytest.raises to look for that specifically, instead of checking the response body.

That means we push aspen.Response down into the gittip library, which might feel wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like testing for the error message itself, because that's what actually gets sent to the user. It ensures that a human-intended error message is being sent, as opposed to something useless like "ERR 234325"

if len(accounts) == 1:
raise LastElsewhere()
c.one("""
DELETE FROM elsewhere
Copy link
Contributor

Choose a reason for hiding this comment

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

Why delete from elsewhere here? Why not just set elsewhere.participant to a stub?

Copy link
Contributor

Choose a reason for hiding this comment

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

DELETE FROM elsewhere is our current account disconnect process, so it's fine here. IRC

chadwhitacre added a commit that referenced this pull request Feb 28, 2014
Add ability to disconnect elsewhere accounts.
@chadwhitacre chadwhitacre merged commit ccc989d into master Feb 28, 2014
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.

implement account disconnect
4 participants