Commit Graph

5341 Commits

Author SHA1 Message Date
neiljp (Neil Pilgrim) 67f1a72aae mypy: Ensure events test fails only due to settings absence. 2017-08-07 21:27:50 -07:00
neiljp (Neil Pilgrim) 3711da0dc9 mypy: Mark request_data as Optional based on requests API. 2017-08-07 21:27:50 -07:00
neiljp (Neil Pilgrim) 116b8dd9c9 mypy: Set assign_queue() parameter queue_type to not be Optional. 2017-08-07 21:27:50 -07:00
neiljp (Neil Pilgrim) 24cc14c10d mypy: Refer to default_stream in if statement, allowing type inference. 2017-08-07 21:27:50 -07:00
neiljp (Neil Pilgrim) 60baedcab9 mypy: strict-optional fixes for Trello integration. 2017-08-07 21:27:50 -07:00
neiljp (Neil Pilgrim) d9e36c8156 mypy: strict-optional fixes in zerver/tornado/socket.py. 2017-08-07 21:27:50 -07:00
Jack Zhang d9c1ad5db2 hotspots.py: Add SEND_ALL flag.
Used to view all hotspots in development.
2017-08-05 18:32:37 -07:00
Harshit Bansal 5a5072730c realm_emoji: Don't accept animated realm emoji with unequal dimensions.
Fixes: #3654.
2017-08-05 18:07:21 -07:00
neiljp (Neil Pilgrim) 334348cbca mypy: Use namedtuples for request objects in test_messages.py. 2017-08-05 17:53:18 -07:00
neiljp (Neil Pilgrim) 6bed9da353 mypy: Amend flock contextmanager to accept Union[int, IO[Any]]. 2017-08-05 17:53:18 -07:00
Tim Abbott fc0144f6e4 test_decorators: Annotate fake Request as HttpRequest. 2017-08-05 17:53:18 -07:00
Tim Abbott 4bb979d869 test_helpers: Fix annotation for avatar_disk_path. 2017-08-05 17:53:18 -07:00
neiljp (Neil Pilgrim) 3ca34bebdc mypy: Use Callable as parameter for simulated_queue_client.
Previously the type was annotated as 'type'.
2017-08-05 12:08:59 -07:00
neiljp (Neil Pilgrim) 6717f361ec mypy: Amend tornado_redirected_to_list calls to use Mapping. 2017-08-05 12:08:59 -07:00
Rishi Gupta 4bf8ac2498 generate_test_data: Replace source with non-Gutenberg text.
It's hard to find literature with the community tone we're going for, that
is consistent with the Zulip code of conduct, etc.

This commit removes the special tooling for Gutenberg plays, and changes the
text to be some mixture of scigen, Communications From Elsewhere,
chat.zulip.org, and various books from the public domain.
2017-08-05 11:04:35 -07:00
Rishi Gupta 4350b52740 generate_test_data: Fix remove_line_breaks algorithm. 2017-08-05 11:04:35 -07:00
Tim Abbott dd49bec93c Fix changing email addresses back after email change.
We apparently were not correctly clearing the user_profile's email
address from caches when changing email addresses, which meant that
trying to look up the old email in the user_profile caches would still
work.

Fixes #6035.
2017-08-05 10:49:44 -07:00
Rishi Gupta 251bd3e577 registration.py: Remove first_in_realm from accounts_register.
The parent commit implies first_in_realm == realm_creation.
2017-08-05 10:17:14 -07:00
Rishi Gupta ddbf8b9c3c management: Remove create_realm.py.
This no longer does the correct thing (in terms of onboarding emails,
default streams, etc), and is tempting for new server admins to use.

Once we remove it we'll also have the invariant that we can't have a realm
without a user, which will simplify accounts_register a bit.
2017-08-05 10:17:14 -07:00
Vishnu Ks e7f5da83ac management: Create list realms command.
Fixes #5917.
2017-08-04 14:25:03 -07:00
Steve Howell 63f7b9a579 Remove "all" option for flag-updating endpoint.
The "all" option for 'message/flags' was dangerous, as it could
apply to any of our flags.  The only flag it made sense for, the
"read" flag, now has a dedicated endpoint.
2017-08-04 14:10:46 -07:00
Steve Howell bc6543a236 Use do_mark_all_as_read() in bankrupt_users command. 2017-08-04 14:10:46 -07:00
Steve Howell 541156792e Add /mark_all_as_read endpoint.
This change simplifies how we mark all messages as read.  It also
speeds up the backend by taking advantage of our partial index
for unread messages.  We also use a new statsd indicator.
2017-08-04 14:10:46 -07:00
Steve Howell c5e4ce5278 Optimize show_unreads --fix approach.
This now breaks the process of cleaning up unread counts for
non-active streams into a three step process.

This allows us to use our unread message flags index, at least
in testing on dev.  Here is the relevant excerpt from explain
analyze:

    Bitmap Index Scan on zerver_usermessage_unread_message_id
2017-08-04 11:04:43 -07:00
Greg Price cc30226af0 deliver_email: When disabled, sleep forever rather than exit.
This makes supervisor see the service as cheerfully running
and let it alone, rather than constantly retry starting it.
Because the crash/restart loop means repeatedly spending a
couple of seconds loading Django and the app, separated by
brief periods while supervisor notices the crash and acts
on it, it was actually consuming about 30-50% CPU on the
zulipchat.com staging server.
2017-08-03 16:28:19 -07:00
Steve Howell e994ff36b5 Add option to fix unread messages for inactive streams. 2017-08-03 13:17:04 -07:00
Steve Howell dad1c9326e Add show_unreads management command.
This should help us troubleshoot anomalies with old unread
messages.
2017-08-03 13:17:04 -07:00
neiljp (Neil Pilgrim) b19e62b7ce mypy: Initialize search_term to {} rather than None & avoid Optional. 2017-08-03 11:09:50 -07:00
neiljp (Neil Pilgrim) e772e89fe2 mypy: Add None return path for RateLimitMiddleware.process_exception(). 2017-08-03 11:03:14 -07:00
neiljp (Neil Pilgrim) 0e68c44ca4 mypy: Allow get_display_recipient_by_id type_id to be Optional[int].
zerver/message.py used it in this way previously when the type was not
a stream, so the type has been set to match usage and implementation.
Also added docstring to clarify this for the specific function.
2017-08-03 11:03:14 -07:00
neiljp (Neil Pilgrim) 1c7d0c932a mypy: Ensure type of trim_func is consistent in check_redis.py. 2017-08-03 11:03:14 -07:00
neiljp (Neil Pilgrim) 814dce0452 mypy: Set self.doc_context in integrations.py to Optional. 2017-08-03 11:03:14 -07:00
Umair Khan ef1b880082 rate_limiter: Upgrade api_calls_left to generic API. 2017-08-02 18:01:39 -07:00
Umair Khan 81e2128774 rate_limiter: Upgrade incr_ratelimit to generic API. 2017-08-02 18:01:39 -07:00
Umair Khan 9e33917d25 rate_limiter: Upgrade max_api_calls to generic API. 2017-08-02 18:01:39 -07:00
Umair Khan ca9ac1948e rate_limiter: Upgrade max_api_window to generic API. 2017-08-02 18:01:39 -07:00
Umair Khan 9c08b62448 rate_limiter: Upgrade unblock_user to generic API.
Change name to unblock_access as well.
2017-08-02 18:01:39 -07:00
Umair Khan 23be0875a1 rate_limiter: Upgrade block_user to generic API.
Change name to block_access as well.
2017-08-02 18:01:39 -07:00
Umair Khan b2a2664715 rate_limiter: Upgrade clear_user_history to generic API.
Changes the name of the function to change_history as well.
2017-08-02 18:01:39 -07:00
Umair Khan dd281367ae rate_limited: Upgrade is_ratelimited to generic API. 2017-08-02 18:01:39 -07:00
Umair Khan 3643c4a73e rate_limiter: Use RateLimitedUser class.
This commit lays groundwork for transitioning to using RateLimited
class in our rate limiter API.
2017-08-02 18:01:39 -07:00
Steve Howell 257e110996 unread: Only send clients 5000 most recent unread messages. 2017-08-02 09:40:47 -07:00
Vaida Plankyte 02d65a67af frontend: Edit confirm_continue_registration.html to be clearer.
Fixes #5707.
2017-08-02 08:51:25 -07:00
Rishi Gupta 082c3a3c93 portico: Add for-working-groups-and-communities.md. 2017-08-02 00:19:34 -07:00
Rishi Gupta 94f7a5704f portico: Add for/companies. 2017-08-02 00:19:34 -07:00
Tim Abbott 32a5a54ba5 test_docs: Fix test for the redesigned /features page. 2017-08-02 00:09:32 -07:00
Tim Abbott c095ac6279 generate_test_data: Fix typo in configuration. 2017-08-01 23:45:57 -07:00
Rishi Gupta 3e9a85ecb2 onboarding: Add turtle reaction to an initial message. 2017-08-01 22:51:05 -07:00
Rishi Gupta 31c011dfcc onboarding: Add picture to onboarding messages. 2017-08-01 22:47:57 -07:00
Rishi Gupta f995094441 registration: Split out onboarding messages to onboarding.py. 2017-08-01 22:47:53 -07:00