Tim Abbott
dc2057ff73
dump_pointers and dump_passwords: Add error handling for deleted users.
...
(imported from commit 556c29133a4734014d4640d875c6d6fccc118668)
2012-12-14 17:15:32 -05:00
Keegan McAllister
197d0dcc01
Revert "Pause for 25 ms in between successful get_updates calls"
...
This was not totally effective, and with the previous commit it is no longer
needed.
This reverts commit e86c0b653669cf86b0d8956c2c85eb7610fc342f.
(imported from commit 0de5bfec87147b1336f6f79c33d4e32493e1e508)
2012-12-14 16:22:42 -05:00
Keegan McAllister
44b9925bfc
Configure get_updates timeout in settings.py
...
(imported from commit 2a647bdd73c43ca5fed704925808efafc70da044)
2012-12-14 16:22:42 -05:00
Tim Abbott
ce40de14c9
Add a tool to save/restore user passwords.
...
(imported from commit 59bea04308bc0c42aeef840aa923dbef1919d31d)
2012-12-13 17:10:03 -05:00
Tim Abbott
434765d810
populate_db: Close database connections before shutting down.
...
This avoids some messages being logged by the postgres server.
(imported from commit 86aaa025a36dad6ec14d49b629cfb1ec326f929c)
2012-12-13 17:09:35 -05:00
Tim Abbott
e330be7fc1
dump_pointers: Use timestamps, not IDs, for transmitting the pointer.
...
(imported from commit 9b51b9edc5b0bdfb2305c12a123d554811ec9e06)
2012-12-13 17:09:35 -05:00
Tim Abbott
bda420a0f9
Fix email case issues when restoring user pointers.
...
(imported from commit 84d3288dffc1cb010d8cd2a749fe71aa2a4d0df3)
2012-12-13 17:09:34 -05:00
Tim Abbott
899cbabe23
populate_db: Make some more bits of memory possible for Python to free.
...
(imported from commit 2d8184d05f622475ffab1043a40251644a88c230)
2012-12-13 17:09:34 -05:00
Tim Abbott
cfc3781841
populate_db: Fix StreamColor restore.
...
Previously, the StreamColor restore code didn't properly account for
the fact that most user subscriptions were in pending_subs and thus
not yet in the database.
(imported from commit 2e28c5a68aa045494b9336d7114c23f5c3706c28)
2012-12-13 17:09:34 -05:00
Tim Abbott
7707690231
Decrease memory usage in bulk_create for UserMessage objects.
...
By processing UserMessage objects in batches as we go, this avoids
consuming a large amount of memory that is linear in the size of the
messages log.
(imported from commit 0c42d97f0863da9c079836c60bebcbaeec59f849)
2012-12-13 17:09:34 -05:00
Tim Abbott
9811050a4f
views: Add json_to_list and use it and json_to_dict more.
...
(imported from commit a6fdc85edb8066eab7ca7cfa5f6f5fdf53b10a8c)
2012-12-13 16:39:58 -05:00
Tim Abbott
2280e4a58a
Rename from_json_to_dict to json_to_dict.
...
(imported from commit a96d29c5e9a700c54a29a8777d7a1e5a4ccbd77d)
2012-12-13 16:39:58 -05:00
Waseem Daher
7de057dcb0
Remove unescaped use of stream name in subscriptions page.
...
This was causing issues with our ability to unsubscribe from
streams with " in their names.
The solution here is a bit hacky, since it depends on the JavaScript
being fairly aware of the layout of the DOM, which is not great.
But it works.
This fixes Trac #328 .
(imported from commit a1b6c8e1f3a9daacdc48920a195717aa89b3a9a9)
2012-12-13 15:46:30 -05:00
Waseem Daher
858d638960
Make subscriptions page slightly more robust to weird characters.
...
This fixes Trac #522 , which previously prevented you from
subscribing to a stream named
'"]'); alert('hi');
This does not fix #328 , which is that you can't unsubscribe
from 'Waseem', among other things.
(imported from commit 869063cafa9e7e988aea993d072ca1ad880bcee1)
2012-12-13 15:46:30 -05:00
Waseem Daher
622bcb9ef4
Call the colorpicker drawing code just once, rather than in a tight loop.
...
Unfortunately, this doesn't actually give us much performance gain
either; it's not really the calls to 'find' that are taking any time.
But I do find this a little cleaner as well.
Simply initializing 100 colorpickers with our options takes about 700ms.
Initializing ~100 colorpickers with the total default set of options
shaves that down to about 300-400ms (though obviously doesn't quite
achieve what we want).
(imported from commit 7084b35fb6e77600edfcdcfcc2761a11e6f38c03)
2012-12-13 15:46:30 -05:00
Waseem Daher
cd237c3429
Smarter template invocation on settings page.
...
Rather than calling the template generating code once per
subscription, let's just do it in a batch when possible.
With about 100 subscriptions, the "fetch" call takes about 800ms to
render (while testing locally) both before and after this change,
which is somewhat disappointing.
But this *is* cleaner!
(imported from commit 9ba8819524da86c00a2508349be0ea0ddd48606b)
2012-12-13 15:46:30 -05:00
Tim Abbott
e7b74060d2
Log password change events via the password reset feature.
...
(imported from commit bbec7074229e8779c81d439d4eef373b5dac9fa7)
2012-12-13 15:22:35 -05:00
Luke Faraone
7ee945062d
Add command to mark users as inactive.
...
This is useful when testing the sigup workflow, as this script enables you
to run through a MIT signup without manually creating a new inactive user
in the database.
(imported from commit c22649cc7c561c2fbe8682d1b17d7e5aba9ac04e)
2012-12-13 14:15:31 -05:00
Tim Abbott
e6fef7d7ba
Fix confusion of user / user_profile objects in MIT signup codepaths.
...
(imported from commit f39943bf31f705365ed9743c6d2e9239fed8c9e2)
2012-12-13 13:32:34 -05:00
Waseem Daher
4108f2f817
Add a 'realm' column to the activity page.
...
This makes it easier for me to, e.g. check on all of CUSTOMER1.
(imported from commit 1970df29b08b299cd1d00013abecefd7efbffb48)
2012-12-12 18:05:54 -05:00
Tim Abbott
1681651b7d
Add dump_useractivity migration helper tool.
...
(imported from commit 6ceb437447c51be16b5eb0375de2f3bcf3fb14d0)
2012-12-12 15:45:55 -05:00
Tim Abbott
7cebbd4a52
Add datetime_to_timestamp library function.
...
(imported from commit 28466ac5c8fc406ec70a61cae5975a784eb0f238)
2012-12-12 15:45:37 -05:00
Tim Abbott
a086307e6a
Add command to dump and restore user pointers.
...
For use in database migrations.
(imported from commit f06ae569fe986da5e7d144c277bf27be534c04f9)
2012-12-12 15:45:35 -05:00
Tim Abbott
565acffbc5
Fix populate_db pointer restore.
...
(imported from commit e7984f5a762fde833c3b8520ef556fbd841aacbb)
2012-12-11 17:18:59 -05:00
Tim Abbott
c21535d420
models: Create database indexes on auxiliary Message fields.
...
I suspect we'll want these for narrowing code at some point.
(imported from commit d2077aa4d7a6967bb4cb7d9404a4db4fcf824343)
2012-12-11 17:17:38 -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
3014a12cef
populate_db: Truncate too-long messages on replay.
...
(imported from commit 4d89bf8a9235d5ed65863a851a13c91f4fb8632e)
2012-12-11 17:17:38 -05:00
Keegan McAllister
b283123382
bugdown: Remove special treatment of backslash
...
Fixes #562 .
(imported from commit aa39cf390ef44275c7d5a84ca954c75535d372b1)
2012-12-11 16:54:10 -05:00
Zev Benjamin
695d9a4dc6
Change get_updates_params.reload_pending to reload.is_pending() as the former no longer exists
...
(imported from commit fdc59a27230cb49adee2f5444e440aaa84103e5e)
2012-12-11 16:40:26 -05:00
Jessica McKellar
2f1f1fa6be
Add tests for /json/get_old_messages.
...
(imported from commit 36a076af79635a11d9d48439bd92dfa694ed9df6)
2012-12-11 16:07:09 -05:00
Jessica McKellar
41e688d913
Add exception handling around database lookups based on user data.
...
(imported from commit 4ddab2ed130ef57c967cc9364f8890a4c5b5e347)
2012-12-11 16:07:09 -05:00
Jessica McKellar
435c98b35c
Be more picky about the type of get_old_messages's narrow POST parameter.
...
This addresses 500s observed on prod due to bad narrow values.
(imported from commit 5a865ce41e8a90d3990332d906cba4336eb53ada)
2012-12-11 16:07:09 -05:00
Tim Abbott
cba3ad8315
Humbug errors: Only display most useful request fields.
...
(imported from commit 1d7803b5cd1fb099cecbd14af42e2c48d263bdae)
2012-12-11 16:06:12 -05:00
Tim Abbott
1575c522e1
Humbug errors: Adjust the subject to show server name.
...
(imported from commit 398f0988e7817212a455c73e811be2238695de83)
2012-12-11 16:06:12 -05:00
Tim Abbott
25d95e25c8
Humbug errors: Remove unnecessary newlines in tracebacks.
...
(imported from commit ad5834fa32e13ede1c634e4e9e535d84eb833c95)
2012-12-11 16:06:12 -05:00
Tim Abbott
4dae30e750
Re-enable markdown for all realms but CUSTOMER1Labs.
...
(imported from commit 51e770b50e8c678c245d099dc9177aa49ecb5084)
2012-12-11 12:04:46 -05:00
Zev Benjamin
ebb9cfa65d
Re-enable markdown rendering for API users and the github bot
...
(imported from commit 31db13ef8b7e5224a07f784247092e2eb9cd1654)
2012-12-11 12:02:05 -05:00
Tim Abbott
100df7e349
Add a maximum message length of 10000 characters.
...
(imported from commit a07c872d612521c9792be8dc704a9cfd6c752c75)
2012-12-11 11:33:40 -05:00
Zev Benjamin
19108929a7
github: only describe the first several commits in push notifications
...
(imported from commit aa26d2ae1d2d30350ec6e30729fb5652f385bd19)
2012-12-11 11:04:37 -05:00
Luke Faraone
b9b7d1b8f1
Linebreak zephyrs.
...
(imported from commit c77499b17ce195e36169bcb39a5f5bdfe6a3ce51)
2012-12-10 15:45:04 -05:00
Tim Abbott
6cff3dc735
models: Disable markdown (escaping instead) for now.
...
(imported from commit e92920919cd5d0ef11a478be5a0f8a108b62fff9)
2012-12-10 15:23:57 -05:00
Luke Faraone
6ff666b9d7
Filter out "content" and "secret" from exceptions.
...
(imported from commit 31206f528fc93746133ebe2d9234b6ce0b88cf3b)
2012-12-07 17:32:16 -05:00
Luke Faraone
ced8062509
Use MAX_SUBJECT_LENGTH instead of hardcoded constant.
...
(imported from commit cc885f7ca196ec1de0279a6a6192044ff7c8420f)
2012-12-07 17:32:16 -05:00
Luke Faraone
c65d6113ed
Factor out notifying of a new user into a separate function, notify on manage.py create_user.
...
(imported from commit 1a6aa0536dbfea8035b6bbd76528e70d90aa8b60)
2012-12-07 17:32:16 -05:00
Luke Faraone
7fbee21584
Factor out Message() creation for internal use into separate function.
...
(imported from commit 0352010da4255fc74cd67835e04dbdb1f8bbf4e9)
2012-12-07 17:32:15 -05:00
Luke Faraone
5b70b4a04f
Introduce new manage.py command which creates users with default passwords.
...
(imported from commit ba5ed9cb6ee91435b184845019391e5dc38fc3aa)
2012-12-07 17:32:15 -05:00
Luke Faraone
a604183c5b
Log errors to Humbug, too.
...
(imported from commit 2547625135568f3ea004bf4287471a82bc0a4f38)
2012-12-07 17:32:15 -05:00
Waseem Daher
d04758f5f1
Don't make it seem like the composebox messagebox is clickable.
...
(imported from commit cd5840b42c11e69e87fa51085f152a193ec8aebd)
2012-12-07 15:57:35 -05:00
Waseem Daher
4397400ab4
An ugly reminder of the shortcut for sending messages.
...
Hopefully this will make things slightly more discoverable;
the previous solution (putting a prompt in the initial text)
was not that discoverable.
(imported from commit f6a7fce1bfd27bda412522768e981b2ffc39f474)
2012-12-07 15:37:25 -05:00
Waseem Daher
4bb330bb21
Allow 'Esc' to clear a keyboard-driven Find.
...
(imported from commit d48028531b6e7286d177790ec5adb2e5f256b1e0)
2012-12-07 15:01:20 -05:00