Merge lp:~stefanor/ibid/identity-370434 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Stefano Rivera
Status: Merged
Approved by: Jonathan Hitchcock
Approved revision: 619
Merged at revision: 628
Proposed branch: lp:~stefanor/ibid/identity-370434
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~stefanor/ibid/identity-370434
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Michael Gorven Approve
Review via email: mp+6106@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefano Rivera (stefanor) wrote :

Cross it of the todo, cocooncrash?

Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve
Revision history for this message
Jonathan Hitchcock (vhata) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/identity.py'
2--- ibid/plugins/identity.py 2009-04-27 00:50:19 +0000
3+++ ibid/plugins/identity.py 2009-05-01 22:54:46 +0000
4@@ -43,7 +43,14 @@
5 session.flush()
6 log.info(u"Created account %s (%s) by %s/%s (%s)", account.id, account.username, event.account, event.identity, event.sender['connection'])
7
8- if not admin:
9+ if admin:
10+ identity = session.query(Identity).filter_by(identity=username, source=event.source.lower()).first()
11+ if identity:
12+ identity.account_id = account.id
13+ session.save_or_update(identity)
14+ session.flush()
15+ log.info(u"Attached identity %s (%s on %s) to account %s (%s)", identity.id, identity.identity, identity.source, account.id, account.username)
16+ else:
17 identity = session.query(Identity).filter_by(id=event.identity).first()
18 identity.account_id = account.id
19 session.save_or_update(identity)

Subscribers

People subscribed via source and target branches