Commit Graph

15 Commits

Author SHA1 Message Date
Jessica McKellar 83a8ed048f Remove unused imports in zephyr/lib/.
(imported from commit 54fa64f34d29ede939d18f3834249b7bff4490e5)
2013-06-02 15:12:27 -04:00
Tim Abbott abd9e4e635 Use proper randomization when generating new API keys.
Previously we were generating API keys deterministically using a hash
of the user's email address; this is clearly not a good long-term
approach.

(imported from commit 14d0c7c9edbc45b3ae1d17a43765ad9726338d4d)
2013-05-29 15:11:24 -04:00
Zev Benjamin 73be68fbb9 [schema] Add support for bot users
(imported from commit 634a8211b41fd0040c95b51b96a88d3517fa8cf4)
2013-05-11 02:38:32 -04:00
Luke Faraone 71a91197fa Enable absolute imports.
See PEP 328[1] for details. This feature was introduced in Python 2.5 and
will become mandatory in Python 3.

[1]: http://www.python.org/dev/peps/pep-0328

(imported from commit 7444eeba8a08d5f91b94c7921848f2274979bd76)
2013-04-23 09:51:17 -07:00
Tim Abbott 1cec86eb2d [manual] Remove now-unused User model.
I think all that one needs to do to deploy this commit is on developer
laptops, run `generate-fixtures --force`.

(imported from commit 34916341435fef0875b5a2c7f53c2f5606cd16cd)
2013-04-02 12:57:10 -04:00
Tim Abbott 1443edce00 Access the UserProfile's new email field rather than using User.
This is preparatory for stopping using the User model.

(imported from commit a1b0808c8cc2ddd19a25163f91c4f18620c9ce90)
2013-04-02 12:07:08 -04:00
Tim Abbott b82edb6fd6 [manual] Add User fields to the UserProfile model.
And keep the fields updated, by copying on UserProfile creation and
updating the UserProfile object whenever we're updating the User
object, and add management commands to (1) initially ensure that they
match and (2) check that they still match (aka that the updating code
is working).

The copy_user_to_userprofile migration needs to be run after this is
deployed to prod.

(imported from commit 0a598d2e10b1a7a2f5c67dd5140ea4bb8e1ec0b8)
2013-04-01 14:34:25 -04:00
Tim Abbott bd27343eba Fix incorrect use of user_id as a Recipient type_id.
This should be a user_profile_id.

(imported from commit 3d63a986a4584ba8933c4f8872ed9bb5f3928983)
2013-04-01 14:34:25 -04:00
Tim Abbott a4383f8264 Remove batch_bulk_create helper function.
The behavior we require is now standard in Django 1.5.

(imported from commit 509adb0bd371081a2dad7d4a04d24fcffbda7cdc)
2013-03-28 07:36:10 -04:00
Tim Abbott d364e450ea Move create_user to its own file.
(imported from commit b3dc11d3730634b35256dca940d479a81441c062)
2013-02-19 17:36:22 -05:00
Tim Abbott 1a82741650 Move action functions from models.py to zephyr/lib/actions.py.
(imported from commit 9d577dd53ce7d4c9faf6cc8a56129d684a50811b)
2013-01-11 16:11:03 -05:00
Tim Abbott 3c10a2e6a0 Move bulk_create_* methods to bulk_create.py.
(imported from commit 30d5f86209f9c8807516f0440276fafeb6590c1a)
2013-01-10 16:59:36 -05:00
Tim Abbott 02d65664b4 Increase MySQL batch size to 10,000.
This saves 30 seconds in populate_db runtime on MySQL.

(imported from commit 7fe483bf5f32cfa3d09db8ad7a9be79bd0a2a271)
2012-12-11 17:17:38 -05:00
Tim Abbott 95c39cbc76 bulk_create: Use a (large) batch_size with MySQL.
(imported from commit 529fef7dd55bb8a5f4e286f7c896f4b14b0d1b8d)
2012-11-07 15:49:45 -05:00
Tim Abbott d68cf3696b populate_db replay: Use bulk_create to create objects.
This cuts the time required to import 38000 messages (with 140000
message receipts) from about 10 minutes to just under 40 seconds on my
laptop with sqlite.

(imported from commit d53b0d1360408c77f38353b58fbb25875262cb40)
2012-10-20 18:26:18 -04:00