Commit Graph

3952 Commits

Author SHA1 Message Date
Tim Abbott fc192d6b3b push: Don't pass a UserProfile into send_apple_push_notification.. 2017-03-05 18:37:00 -08:00
Tim Abbott 393c4d2eaa push: Don't pass a UserProfile into _do_push_to_apns_service. 2017-03-05 18:37:00 -08:00
Tim Abbott 53c9e3b4ca push: Don't pass a full UserProfile into APNsMessage. 2017-03-05 18:37:00 -08:00
Tim Abbott c8bfd568bc push: Pass devices list into send_apple_push_notification. 2017-03-05 18:36:58 -08:00
Tim Abbott 0ddaf5c610 push: Pass reg_ids list into send_android_push_notification.
This refactoring is preparation for being able to forward push
notifications to users on behalf of another Zulip server.

The goal is to remove access to the current server's database from the
send_*_push_notification code paths.
2017-03-05 18:36:07 -08:00
Tim Abbott b1b2d8d2c7 push: Move handle_push_notifications to push_notifications.py. 2017-03-05 18:32:09 -08:00
sinwar 6f0564e9f4 python: Fix remaining bare excepts in codebase.
Fixes #2862.
2017-03-05 16:17:04 -08:00
Tim Abbott 08e1759ad0 bots: Replace bare excepts with targeted exceptions. 2017-03-05 16:17:04 -08:00
Steve Howell 419a3174f1 Send stream_id in stream/update events. 2017-03-05 15:44:42 -08:00
Steve Howell 0bb1af0fd9 Send stream_id in subscription updates. 2017-03-05 15:26:00 -08:00
Tim Abbott b6f53d6c14 coverage: bring zerver/lib/validator.py to 100% coverage. 2017-03-05 00:53:27 -08:00
Tim Abbott 2f8bb1b1cd coverage: Add test for REST requests to /json API unauthed. 2017-03-05 00:53:27 -08:00
Tim Abbott c8e38aaa55 coverage: Add coverage for OPTIONS HTTP method. 2017-03-05 00:53:26 -08:00
Tim Abbott e95f139308 coverage: bring zerver/lib/response.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott 89decf6ded coverage: bring zerver/lib/request.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott e7ff3415ab coverage: bring test_helpers.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott 546fb9199d coverage: bring test_classes.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott e3cfb256dd coverage: Bring zerver.lib.narrow.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott 56b1f79fe3 integrations: Fix email integration being listed unconditionally. 2017-03-05 00:53:26 -08:00
Tim Abbott 464928fdcc bugdown: Fix mypy error with python 3 coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott a53240a47c test_subs: Fix buggy assertion statement. 2017-03-04 23:57:56 -08:00
Tim Abbott 6c12a49d04 test_auth_backends: Remove now-unnecessary compatibility code.
This code was added as part of the Django 1.10 migration to make our
tests work with both Django 1.8 and 1.10.  Now that we're on 1.10,
it's no longer required.
2017-03-04 23:38:46 -08:00
Tim Abbott 39704bac6c test_bugdown: Remove unused common_bugdown_test. 2017-03-04 23:35:46 -08:00
Tim Abbott 1a8bc5f383 coverage: Bring test_decorators to 100% coverage. 2017-03-04 23:34:28 -08:00
Tim Abbott c73c3c52f8 test_email_mirror: Fix TestCommandMTA.
The test didn't actually use the mock, due to an incorrect import
path.
2017-03-04 23:28:48 -08:00
Tim Abbott 6ea3a9cb1d coverage: Bring test_templates.py to 100% coverage. 2017-03-04 23:28:48 -08:00
Tim Abbott 8d9cab2339 test_narrow: Use AssertionError properly. 2017-03-04 23:19:16 -08:00
Tim Abbott d8171b2efc coverage: Bring tests.py to 100% coverage. 2017-03-04 23:17:36 -08:00
Tim Abbott 768307d921 coverage: Bring test_events to 100% coverage. 2017-03-04 23:12:32 -08:00
Tim Abbott d4f0e394e9 test_unread: Bring to 100% test coverage.
This actually fixes a test bug where we weren't actually verifying
whether other users' messages were being marked as read.
2017-03-04 23:09:45 -08:00
Tim Abbott 538570b7c1 test_subs: Bring to 100% test coverage. 2017-03-04 23:07:56 -08:00
Tim Abbott 065651b4fe coverage: Exclude uncovered lines in test_signup. 2017-03-04 23:01:50 -08:00
Tim Abbott ff9f827c9a coverage: Don't require coverage in six.PY2/PY3 branches. 2017-03-04 22:51:35 -08:00
Tim Abbott bd0d6bb9d2 docs: Add discussion of VFL to front-end-build-process.md.
Also, link to this from various Python files where relevant.
2017-03-04 21:14:17 -08:00
Tim Abbott 233c5eb255 mypy: Add UserProfile import in avatar_hash.py. 2017-03-04 20:24:47 -08:00
Tim Abbott d95412425a generate_realm_creation_link: Fix line-wrapping of help text. 2017-03-04 19:02:01 -08:00
feorlen 3c954096f6 generate_realm_creation_link: Check for an uninitialized database.
This provides a nice error message to users who miss a step in the
instructions.

Fixes #3672.
2017-03-04 19:01:01 -08:00
adnrs96 3f58e20993 Refactor: Change user_avatar_hash with user_avatar_path at all calls.
In this commit we change user_avatar_hash with user_avatar_path which
now returns paths to avatars based on the email hash.

Tweaked by tabbott to avoid an import loop.
2017-03-04 18:39:49 -08:00
Tim Abbott 5488de11e6 migrations: Renumber 0059_userprofile_quota to fix conflict. 2017-03-04 18:38:27 -08:00
Philip Skomorokhov 866a7b06b2 upload: Limit total size of files uploaded by a user to 1GB.
Fixes #3884.
2017-03-04 18:08:30 -08:00
Tim Abbott 80232425f4 user_settings: Clean up error messages and tests for email change. 2017-03-04 17:32:48 -08:00
Raghav Jajodia cd2d798498 admin: Added realm option to prevent users from changing their email.
A realm option to prevent users from changing their email address is added.
Fixes #3777.
2017-03-04 17:32:48 -08:00
Tim Abbott d25bfb88d3 lint: Ban importing zerver.models in database migrations.
This doesn't work correctly, but in a subtle way.
2017-03-04 17:32:48 -08:00
Tim Abbott 219c519186 migrations: Fix upgrade process for RealmAuditLog migration.
You aren't allowed to import from `zerver.models` in migrations.
2017-03-04 17:24:04 -08:00
Raghav Jajodia ec77aa0dfb user_settings: Add auth check before confirm_email_change.
This isn't strictly necessary, but adds a little bit of extra security
to the overall email change flow.
2017-03-04 17:05:25 -08:00
Rishi Gupta 8feea6c598 analytics: Add LoggingCountStat for number of users. 2017-03-04 16:46:09 -08:00
Rishi Gupta 51b7677db7 Add RealmAuditLog table and record user activation/deactivation events.
The RealmAuditLog will make it easier for server admins to replay history.
2017-03-04 16:45:44 -08:00
Tim Abbott 34ade097ca mypy: Work around obnoxious async error. 2017-03-04 15:39:53 -08:00
Tim Abbott 75e81253f2 mypy: Work around several new mypy bugs in 0.501. 2017-03-04 15:33:39 -08:00
Raghav Jajodia a3a03bd6a5 mypy: Added Dict, List and Set imports.
Fixed mypy errors associated with the upgrade.
2017-03-04 14:33:44 -08:00