Merge lp:~canonical-isd-hackers/canonical-identity-provider/limit-sql-queries into lp:canonical-identity-provider/release
Status: | Merged |
---|---|
Approved by: | Ricardo Kirkner |
Approved revision: | no longer in the source branch. |
Merged at revision: | 188 |
Proposed branch: | lp:~canonical-isd-hackers/canonical-identity-provider/limit-sql-queries |
Merge into: | lp:canonical-identity-provider/release |
Diff against target: |
420 lines (+115/-106) 10 files modified
.bzrignore (+4/-0) identityprovider/auth.py (+35/-32) identityprovider/forms.py (+18/-31) identityprovider/models/account.py (+31/-26) identityprovider/tests/test_models_account.py (+8/-7) identityprovider/tests/test_views_ui.py (+1/-1) identityprovider/utils.py (+10/-0) identityprovider/views/ui.py (+5/-7) identityprovider/views/utils.py (+1/-0) wsgi_test_server.py (+2/-2) |
To merge this branch: | bzr merge lp:~canonical-isd-hackers/canonical-identity-provider/limit-sql-queries |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ricardo Kirkner (community) | Approve | ||
Review via email: mp+67853@code.launchpad.net |
Commit message
Limited number of SQL queries when user logs in.
Description of the change
Overview
========
This branch limits number of queries issued by the SSO when user is logging in.
Details
=======
There are couple ways in which the SQL queries are limited:
- using django's ability to query over foreign keys (which means that Django will issue a SQL JOIN),
- using select_related() to get linked models,
- not getting the object twice from the db (LoginForm and login view).
Testing
=======
Follow instructions in README and then '$ fab test' to verify all things are still working. Using $ fab run and logging in you can see exact queries which are issued (with summary saying 11 queries with 2 duplicates).
Excellent work!
Really like the changes around l. 303-308