Commit Graph

69 Commits

Author SHA1 Message Date
Tim Abbott 2c89103b23 Actually update current subscriptions based on changes in logs.
(imported from commit b36637562dd0e358f1718d38778c735bb75fd77a)
2012-10-20 18:41:51 -04:00
Tim Abbott 56dab6cb26 Log changes to subscriptions and replay them in populate_db.
(imported from commit d3055eb44326bdc59a6bc96d00b5b0bc6da86059)
2012-10-20 18:26:21 -04: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
Tim Abbott b2ce9aaa18 populate_db replay: Parse the json from old messages first.
(imported from commit bdd900b7618ce85d27eebe4d2a745c4d2734cb85)
2012-10-20 10:44:50 -04:00
Tim Abbott e434fa141e Use .objects.create and .objects.get_or_create.
This eliminates a bunch of unnecessary code and also fixes a bunch of
places where we were improperly not using transactions.

(imported from commit f194ae9226f9229fc56a0b1b21615534f486ea0c)
2012-10-19 17:42:14 -04:00
Keegan McAllister bbb67f61cc populate_db: Indicate progress on --replay-old-messages
(imported from commit 1f1043bca0952650c744d6012b11d607f2eb3cde)
2012-10-19 15:17:34 -04:00
Keegan McAllister b9e9938197 create_user_if_needed: Use proper initial passwords
(imported from commit 009208ac64548dd6f8773ccc7738ab0c391d816a)
2012-10-17 21:08:59 -04:00
Keegan McAllister ea916951f4 Disable notify_new_message calls in testing and populate_db
(imported from commit 07a0fea4173e2e27a90ac5f111927f0000377764)
2012-10-17 18:23:01 -04:00
Keegan McAllister cc8a14fcf8 Create accounts with passwords which are deterministic but hard to guess (from the outside)
(imported from commit 964610fec6c4690c1e881f2bab252296663c819a)
2012-10-17 18:23:01 -04:00
Tim Abbott 2de4d1d448 Add social and test to default subs added after DB dumps.
(imported from commit 828c733c9f5d1bdd5fc0aa2e162b800f8db7b22f)
2012-10-11 11:53:57 -04:00
Tim Abbott ac3f4393ff Rename instance to subject.
(imported from commit 6b4693da03f106448c137cf81cf9801cac44f2b8)
2012-10-10 18:01:39 -04:00
Tim Abbott 613010675c Rename class => stream in populate_db.py.
(imported from commit 8546b2e7823f8df0f69b317bb3c6df1a4da49537)
2012-10-10 17:48:17 -04:00
Tim Abbott 44e9e4cebf Rename Recipient.CLASS to Recipient.STREAM.
(imported from commit a530194163f7260c73921137fa1ff671f14516f6)
2012-10-10 17:47:13 -04:00
Tim Abbott 1fc4780a81 Rename create_class_if_needed to create_stream_if_needed.
(imported from commit 1bbc792332981723d3d29b24ad03811d62ced5f1)
2012-10-10 17:47:13 -04:00
Tim Abbott bc3646691d Rename create_classes to create_streams.
(imported from commit 5c2e1f840e4774d392554a4c4cf49746f10550a9)
2012-10-10 17:47:12 -04:00
Tim Abbott 95f95d7e54 klass => model as a local variable to refer to our models.
(imported from commit c58a3133bfd8db13d34f8def4cf73e7526214e8e)
2012-10-10 17:47:12 -04:00
Tim Abbott 8daff2e05e Rename ZephyrClass to Stream.
(imported from commit ae51b7a9e03f322dfe2dfccd250cbfc23adfe32e)
2012-10-10 17:47:12 -04:00
Tim Abbott 2170c7a352 Rename zephyrs to messages in various local variables.
(imported from commit 91ac7e47c51fdcaf6559b06f07e36b041aad3e2c)
2012-10-10 10:29:48 -04:00
Keegan McAllister e1113a6d08 populate_db: Fix mit_subs_list import
(imported from commit b67abb47892d561b9e300a324528303694bcf8de)
2012-10-06 17:53:05 -04:00
Tim Abbott 9cfa8a868f populate_db: Read from the correct messages log path.
(imported from commit ec7ef103ddf06cdc89c02659ceefcab1f64c89e4)
2012-10-05 14:59:23 -04:00
Tim Abbott 52a36945fe populated_db: Rename many functions/variables from zephyr => message.
(imported from commit d796561eded00511e4dfd7fe2bd5ac102125d4ea)
2012-10-03 18:14:15 -04:00
Tim Abbott 1ab81cff92 [schema] Rename Zephyr => Message in the schema.
(imported from commit 4f402f150c45d2097d6b16943935e6e370b4f8d8)
2012-10-03 18:14:15 -04:00
Tim Abbott cca5f7b76a Rename do_send_zephyr to do_send_message.
(imported from commit df4dc741bf00a197ca5ab39373bc9a3eda379684)
2012-10-03 12:27:34 -04:00
Tim Abbott be1a890a09 populate_db: Restore users' pointers to last after database resets.
(imported from commit d6c5a58173602e7e07b6851a6d22ed129b4f3733)
2012-10-02 16:58:13 -04:00
Keegan McAllister 4e6a239580 populate_db: Default to mit.edu realm on inport
This is something of a temporary hack.  In the future, we should make
zephyr_mirror.py smarter about fixing up the realms.

(imported from commit bdcff1a834904616538f430b4513ec7619b95e95)
2012-09-28 18:35:38 -04:00
Tim Abbott 699e05383f Log messages and restore them with populate_db.
(imported from commit 959f038a736e48d32819bc04bd054632a2e911c6)
2012-09-27 15:01:30 -04:00
Tim Abbott 2f4a96e18d Use better random generation of shakespeare lines.
(imported from commit f979a8476f6fd925b9041e15dd38a9c261341be9)
2012-09-27 15:01:30 -04:00
Tim Abbott c8220ee057 Don't store the post-markdown HTML in our database content column.
(imported from commit bb81e84acc04ea0930be1026149618fbb60174fd)
2012-09-26 14:51:14 -04:00
Tim Abbott 11e5e8785d Preparation for syncing messages back to MIT.
(imported from commit 551b697366702de93579de259a9bc644be8d66ec)
2012-09-24 14:31:40 -04:00
Tim Abbott a8e83040e5 Add support for specifying per-user MIT subscription lists.
(imported from commit d6e91917c071e59b5611bfefe326ac47684299c3)
2012-09-24 10:51:49 -04:00
Tim Abbott efd2cb8fa9 Add both Humbug and MIT internal users.
(imported from commit f300c6513a9756417285ba371cb2d3f6f26fc4a3)
2012-09-21 11:15:19 -04:00
Tim Abbott 2d6683f896 Deduplicate user creation code.
(imported from commit bda76a9a44bd5ed7f0726b527fdb93cec109cbed)
2012-09-21 10:45:00 -04:00
Tim Abbott 135c82717d Authenticate by email.
Approach from http://www.micahcarrick.com/django-email-authentication.html.

(imported from commit 796b8e08d8e1f9769cd3cf8ee61d3724ac3847b7)
2012-09-21 10:34:48 -04:00
Tim Abbott 967dc37bc2 Put the Shakespeare users in a different realm from the MIT ones.
(imported from commit c75bff78380ee85c00edb4690030b6e0c1b42360)
2012-09-20 18:03:43 -04:00
Keegan McAllister 209bfdf16a populate_db: style fixes
(imported from commit bf16e9a745407a95917e4765257c54dd342fcacc)
2012-09-20 11:22:39 -04:00
Keegan McAllister 16b53fc1ef populate_db: Provide option to create extra users
(imported from commit 13d24c2af3911a06138e73619aa6091a9aeb4f1a)
2012-09-20 10:47:25 -04:00
Keegan McAllister db7a8277ff Replace create_{user_profile,zephyr_class} with {UserProfile,ZephyrClass}.create
Looks nicer and cuts down on imports.

(imported from commit 4fdbbb45cf6d8ad016481c663cf52fd555b41d91)
2012-09-19 13:01:58 -04:00
Keegan McAllister f003dddebb populate_db: Remove unused variables
(imported from commit 3f8f40134858721b372f3971c3b7ced31f9ed49e)
2012-09-17 21:55:38 -04:00
Keegan McAllister bdb1c1b97e populate_db: Break up a long line
(imported from commit cb9d1a785751af6115cbbffc4f21bc09d38cc0fa)
2012-09-17 21:39:21 -04:00
Keegan McAllister 7152fe2f73 Format messages with Markdown
(imported from commit 014a4dddd4d3db61d85c6f6bf1987aff6093fb52)
2012-09-17 15:24:41 -04:00
Tim Abbott da2494004d Make populate_db thread count an option.
(imported from commit b65de0a25a7c345a422e8f4f236bf49025c97886)
2012-09-17 11:37:14 -04:00
Tim Abbott 0b699be7eb Add some caching of userprofile objects.
(imported from commit dd8e1bec2d677e873d90806aa71519c3a37221c8)
2012-09-17 11:37:11 -04:00
Tim Abbott 2fb626c106 Fix running populate_db more than once in a row.
(imported from commit 72a59b8e6a8cedeb5ca7d242fdfd40fb3f691bc3)
2012-09-14 16:25:11 -04:00
Tim Abbott 09b1285ac1 populate_db: Create the new zephyrs in parallel.
(imported from commit e550d4f6c68502ca27a3dbdc99a495a1c4e710ac)
2012-09-14 13:32:26 -04:00
Tim Abbott 4cc2a7ef60 Restructure populate_db to use more functions.
(imported from commit a2757292c6e2ea33433ebf2028c3322c00b03a2f)
2012-09-14 13:32:25 -04:00
Keegan McAllister 054c30a6db Move MIT Zephyr subs list into its own file
(imported from commit 260ed986c1d69c141e42bea4803ebe0396a86715)
2012-09-12 20:30:07 -04:00
Jessica McKellar e60959ab64 populate_db: give users full names.
(imported from commit db78a76d983dab077dfb105431e549b46e4c60d8)
2012-09-11 16:35:00 -04:00
Tim Abbott a983276b16 Add support for populate_db adding to the existing messages.
(imported from commit 765243923c67ff4820b4cd873764a5e8172cf177)
2012-09-11 10:50:48 -04:00
Tim Abbott 37b1c1db11 Stop using foo.pk when we mean foo.id.
(imported from commit b86359254415f65b32eeefdfbcb38d7bb862c1ac)
2012-09-10 13:43:17 -04:00
Tim Abbott ca132789bb [schema] Store Recipient types more efficiently.
(imported from commit e0625ce9d2382682a5c8d53a5ac31a0399075df8)
2012-09-10 10:03:50 -04:00