zulip/zephyr
Tim Abbott 3b7d61e45f tornado: Get User and UserProfile objects from a memcached.
This commit has the effect of eliminating all of the non-UserActivity
database queries from the Tornado process -- at least in the uncached
case.

This is safe to do, if a bit fragile, since our Tornado code only
accesses these objects (as opposed to their IDs) in a few places that
are all fine with old data, and I don't expect us to add any new ones
soon:

* UserActivity logging, which I plan to move out of Tornado entirely

* Checking whether we're authenticated in our decorators (which could
  be simplified -- the actual security check is just whether the
  Django session object has a particular field)

* Checking the user realm for whether we should sync to the client
  notices about their Zephyr mirror being up to date, which is quite
  static and I think we can move out of this code path.

But implementation constraints around mapping the user_ids to
user_profile_ids mean that it makes sense to get the actual objects
for now.

This code is not what I want to do long-term.  I expect we'll be able
to clean up the dual User/UserProfile nonsense once we integrate the
upcoming Django 1.5 release, with its support for pluggable User
models, and after that I change, I expect it'll be fairly easy to make
the Tornado code only work with the user ID, not the actual objects.

(imported from commit 82e25b62fd0e3af7c86040600c63a4deec7bec06)
2013-01-11 16:11:07 -05:00
..
fixtures Rename zephyrs.json => messages.json in .gitignore. 2012-10-10 10:39:27 -04:00
jstemplates narrow: Remove some unnecessary helpers 2013-01-08 12:18:29 -05:00
lib Move action functions from models.py to zephyr/lib/actions.py. 2013-01-11 16:11:03 -05:00
management tornado: Get User and UserProfile objects from a memcached. 2013-01-11 16:11:07 -05:00
migrations Include autogenerated initial migrations for South. 2013-01-08 18:14:39 -05:00
static Revert "Autocomplete @names in the compose box" 2013-01-11 13:49:23 -05:00
static-access-control Make the back button work when narrowed 2012-12-19 14:46:31 -05:00
tests Add hack to clean up zephyr/lib/time.pyc -- it will break tests. 2013-01-11 15:58:19 -05:00
__init__.py Initial Django commit: basic account, zephyr stream, narrowing, etc. 2012-08-28 12:44:51 -04:00
context_processors.py context_processors: Rename misleadingly named unused parameter 2012-11-07 17:46:46 -05:00
decorator.py tornado: Get User and UserProfile objects from a memcached. 2013-01-11 16:11:07 -05:00
filters.py Filter out additional sensitive POST params 2012-12-19 11:08:24 -05:00
forms.py Move action functions from models.py to zephyr/lib/actions.py. 2013-01-11 16:11:03 -05:00
handlers.py Move action functions from models.py to zephyr/lib/actions.py. 2013-01-11 16:11:03 -05:00
middleware.py Move @has_request_variables error responses to middleware 2012-12-20 14:26:36 -05:00
models.py Move action functions from models.py to zephyr/lib/actions.py. 2013-01-11 16:11:03 -05:00
retention_policy.py exunge_log: Ignore default_streams entries 2012-11-30 17:24:37 -05:00
tests.py Move action functions from models.py to zephyr/lib/actions.py. 2013-01-11 16:11:03 -05:00
tornadoviews.py tornado: Remove normal-runtime query in the user pointers code path. 2013-01-11 16:11:07 -05:00
views.py Move action functions from models.py to zephyr/lib/actions.py. 2013-01-11 16:11:03 -05:00