Commit Graph

3015 Commits

Author SHA1 Message Date
Steve Howell feb94a90aa tests: Add ModelTest class for miscellaneous model tests. 2016-09-19 18:25:02 -07:00
Steve Howell 7d257b03fc test: Add coverage for Recipient.__unicode__(). 2016-09-19 18:25:02 -07:00
Steve Howell e0d59d9386 dead code: Remove Stream.create(). 2016-09-19 18:25:02 -07:00
Steve Howell a67d17b9f7 tests: Add coverage for RealmFilter.__unicode__(). 2016-09-19 14:57:53 -07:00
Steve Howell 5daa2b10d5 tests: Add coverage for RealmEmoji.__unicode__(). 2016-09-19 14:57:53 -07:00
Steve Howell 068a783d88 tests: Test creating user with aliased realm. 2016-09-19 14:57:53 -07:00
Steve Howell 2d0d823a59 tests: Add test_fetch_raw_message(). 2016-09-19 14:25:21 -07:00
Steve Howell 7d4995ded0 tests: Add test_render_message_api(). 2016-09-19 14:25:21 -07:00
Steve Howell d0f9374b71 tests: Add test_messages_in_narrow(). 2016-09-19 14:25:21 -07:00
Steve Howell 318f8e86a1 tests: Extract _update_tsvector_index(). 2016-09-19 14:25:21 -07:00
sunnypalace 3b76a489c9 Remove humbug-user-uploads and related code.
Fixes: #1672.
2016-09-19 10:52:05 -07:00
Steve Howell e2f7f7b672 tests: Add test_update_alert_words(). 2016-09-18 22:08:53 -07:00
Steve Howell a58cad3093 tests: Extract test_alert_words.py 2016-09-18 22:08:53 -07:00
Tim Abbott ec850e3053 Revert "tests: Skip test_get_old_messages_with_search_pgroonga."
This reverts commit 8ae7e7b451.

We believe this issue may have been fixed in
e80279c2e4.
2016-09-18 20:26:35 -07:00
Tim Abbott 8ae7e7b451 tests: Skip test_get_old_messages_with_search_pgroonga.
This test fails nondeterministically, apparently due to a problem in
pgroonga itself.
2016-09-17 12:29:24 -07:00
Steve Howell 1c37c0e93f uploads: Remove redir=False codepath for serving S3 files.
It does not seem that we need to support this any more.  Eliminating
the code gets us to 100% line coverage with our tests on view/uploads.py.
2016-09-17 12:13:07 -07:00
Steve Howell 9c0282139a tests: Add test_serve_s3_error_handling(). 2016-09-17 12:13:07 -07:00
Steve Howell 934385a238 tests: Add test_download_non_existent_file(). 2016-09-17 12:13:07 -07:00
Steve Howell 5c54b53fc0 tests: Add test_file_too_big_failure(). 2016-09-17 12:13:07 -07:00
Steve Howell a630bbf8b8 uploads: Remove dead code in serve_local(). 2016-09-17 12:13:07 -07:00
Steve Howell ca18b631c5 tests: Add ZephyrTest. 2016-09-17 09:29:09 -07:00
Steve Howell 750720116f tests: Add test_update_realm_api(). 2016-09-17 08:31:23 -07:00
Tim Abbott 2c19719cee test_bugdown: Fix i18n test flakiness with markdown rendering tests.
It appears that the assertRaisesRegexp approach we had before didn't
work properly on some systems, likely due to a bad interact with a
i18n (we haven't definitively determined the cause).
2016-09-16 11:49:52 -07:00
Steve Howell a036a72db6 bugdown: Raise BugdownRenderingException.
We now raise an exception in bugdown.do_convert() if rendering
fails, to avoid silent failures, and then calling code can convert
the exception to a JsonableError.
2016-09-16 10:01:55 -07:00
Steve Howell de25f07961 tests: Add BugdownErrorTests. 2016-09-16 10:01:55 -07:00
Steve Howell 152cebf33d bugdown: Extract log_bugdown_error().
(It makes it easier to mock out the logging.)
2016-09-16 10:01:54 -07:00
Steve Howell c4dd3ba0d3 tests: Add test_illegal_name_changes(). 2016-09-16 09:59:26 -07:00
Steve Howell ac0a11f098 tests: Add test_report.py.
This is close to 100% coverage, but the js_source_map stuff will be
tricky, and we may just want to eliminate that soon.
2016-09-16 07:01:40 -07:00
Steve Howell 6ecee2ac4f streams: Simplify list_to_streams().
The list_to_streams() method now uses create_streams_if_needed() to
do its heavy lifting during the autocreate=True case.

This commit gets us to 100% coverage on the streams view.  (The
recently created action.create_streams_if_needed() was easy
to test in isolation, and it has 100% coverage as well, so we are
not cheating here.)

Fixes: #1005.
2016-09-15 10:18:10 -07:00
Steve Howell 8776cc0e35 Add create_streams_if_needed(). 2016-09-15 10:18:10 -07:00
Steve Howell e8119b175d tests: Add test_tutorial.py. 2016-09-15 10:15:18 -07:00
Steve Howell a9e2ceb4e9 push notifications: Fix very minor quirk when adding tokens.
When we push a device token, we want to clean out any other user's
tokens on the device, but not the current user's.  We were wiping
away our own token, if it existed, before creating it again.  This
was probably never a user-facing problem; it just made for dead code
and a little unnecessary DB churn.  By excluding the current user
from the delete() call, we exercise the update path in our tests now,
so we have 100% coverage.
2016-09-15 06:40:18 -07:00
Steve Howell f9cdc63250 tests: Add test_push_api().
We now have 100% coverage on views/push_notifications.py, modulo
some dead code which will be addressed in the next commit.

There were some existing tests in text_external.py, but that
module is really intended for tests that hit external services.

The view is a really simple API that updates a DB table, and the
new test code focuses on error handling and idempotency as well
as the happy path.
2016-09-15 06:39:41 -07:00
Tim Abbott 0f4bbc8617 portico: Add options to disable login and about links.
This gives us a great deal more flexibility for controlling the
context of the portico footer.
2016-09-13 22:59:09 -07:00
Rishi Gupta de11e7c1b3 Add support for subdomain URIs to /api and /api/endpoints.
To the extent possible, we share code with the already-existing
IntegrationView code path.
2016-09-13 22:31:56 -07:00
Tim Abbott bc827b2a6f integrations: Add test for integrations context. 2016-09-13 22:31:55 -07:00
Tim Abbott f9e41b1387 integrations: Factor out ApiURLView base class. 2016-09-13 22:26:47 -07:00
Tim Abbott b7ab83c6ec Move api_endpoint_docs to integrations views file. 2016-09-13 21:58:02 -07:00
Tomasz Kolek acbfe7e624 Add Librato integration.
Fixes: #68.
2016-09-13 21:55:25 -07:00
umkay 6d4f86f951 Add explanation for test_mit_rendering. 2016-09-13 21:23:57 -07:00
umkay 7eb6924841 Wrap dict view object in list for python3 compatibility.
Deleting items from a dictionary being iterated through directly
doesn't work properly in Python 3.
2016-09-13 21:21:45 -07:00
umkay cd1908d04d Add test for password reset flow. 2016-09-13 18:16:50 -07:00
Tim Abbott e93a2e990f Fix nondeterministic parsing failures in GoogleLoginTest.
Apparently, in urllib.parse, one need to extract the query string from
the rest of the URL before parsing the query string, otherwise the
very first query parameter will have rest of the URL in its name.

This results in a nondeterministic failure that happens 1/N of the
time, where N is the number of fields marshalled from a dictionary
into the query string.
2016-09-13 18:13:28 -07:00
Tim Abbott ca91605e85 Extract zerver/views/pointer.py. 2016-09-13 17:30:39 -07:00
Tim Abbott 29495b953a Add test for GET /json/users/me/pointer. 2016-09-13 17:30:39 -07:00
Tim Abbott 6d8af06e32 Fix Google oauth2 logging to use %s for strings.
This has more consistent results in Python 2 vs. Python 3.
2016-09-13 17:30:39 -07:00
Tim Abbott 95a348382b Fix nondeterministic failures in GoogleLoginTest. 2016-09-13 17:26:38 -07:00
Tim Abbott 8fe7488074 views: Remove extract_json_response hack for python-requests.
Now that we are using a virtualenv for dependencies, we can be
confident we will never be using an old system-installed version of
this library.
2016-09-13 17:08:14 -07:00
Tim Abbott b8bdf1365b tests: Add a Google web authentication test suite. 2016-09-13 17:08:14 -07:00
Tim Abbott 97dbf1a8f9 Refactor Google auth error handling to be more testable. 2016-09-13 17:08:14 -07:00
Tim Abbott 9bfe879170 google auth: Fix py3 encoding issues for CSRF computations. 2016-09-13 17:08:14 -07:00
Tim Abbott 4a2282a837 tests.py: Fix missing import needed for mypy. 2016-09-13 17:08:14 -07:00
Steve Howell 51c78571cc tests: Add HomeTest.test_invites_by_admins_only(). 2016-09-13 16:46:05 -07:00
Steve Howell 7cb8f6421d tests: Add HomeTest.test_new_stream(). 2016-09-13 16:46:05 -07:00
Steve Howell eced842f4d tests: Add HomeTest.test_notifications_stream(). 2016-09-13 16:46:05 -07:00
Steve Howell cad12b077f tests: Extract HomeTest._get_page_params(). 2016-09-13 16:46:05 -07:00
Steve Howell 1091b51bb4 tests: Add HomeTest.test_bad_pointer(). 2016-09-13 16:46:05 -07:00
Steve Howell 7f771c64ae tests: Add HomeTest.test_bad_narrow(). 2016-09-13 16:46:05 -07:00
Steve Howell 2bf876d5bb tests: Add HomeTest._sanity_check(). 2016-09-13 16:46:05 -07:00
Steve Howell dc2dde1509 tests: Add HomeTest.test_terms_of_service(). 2016-09-13 16:46:05 -07:00
Steve Howell fa4110b1d9 tests: Extract HomeTest._get_home_page(). 2016-09-13 16:46:05 -07:00
Steve Howell f5f7801302 tests: Extract test_presence.py 2016-09-13 14:51:36 -07:00
Steve Howell 2b4d59d6e8 Fix comment in update_active_status_backend(). 2016-09-13 14:45:27 -07:00
Steve Howell 329fa22f22 tests: Add test_mirror_presence(). 2016-09-13 14:42:18 -07:00
Steve Howell 7f94c74bf8 tests: Add test_invalid_presence(). 2016-09-13 14:36:47 -07:00
Steve Howell edf7ea7f51 tests: Add make_client() test helper. 2016-09-13 14:32:59 -07:00
Tim Abbott 65321b77ac socket: Switch localhost to 127.0.0.1.
It does the same thing, but is a bit more robust to weird DNS
configurations.
2016-09-13 10:01:57 -07:00
Steve Howell 4c5eb3d06e Fix transaction behavior for update_subscriptions_backend().
This commit extracts compose_views() from update_subscriptions_backend(),
and it implements the correct behavior for forcing transactions to roll
back, which is to raise an exception.

There were really three steps in this commit:

- Extract buggy code to compose_views().
- Add tests on compose_views().
- Fix bugs exposed by the new tests by converting errors to exceptions.
2016-09-12 22:03:39 -07:00
umkay 82d03d603a Update Pygments to latest upstream version.
In HTML, the line break immediately following a start tag is ignored
(see: https://www.w3.org/TR/html4/appendix/notes.html#h-B.3.1). An
extra span tag has been introduced in the upstream Pygments
HtmlFormatter in order to preserve the first new line. The Bugdown
Tests as well as our fenced_code.js frontend markdown processor have
been updated to reflect this new behavior.
2016-09-12 21:58:25 -07:00
Tim Abbott e580ed579b Finish annotating zerver/views/messages.py.
These annotations aren't perfect because the sqlalchemy stubs in
typeshed are broken (e.g. a `Select` doesn't have the ability to do
`.where()`, but we've at least used some typevars to make it easy to
address that when the sqlalchemy stubs are less broken).
2016-09-12 08:47:52 -07:00
Tim Abbott e5b8ad6666 Fix teamcity.py annotations. 2016-09-12 08:30:42 -07:00
Tim Abbott d964e5595a Finish annotating test_helpers.py. 2016-09-12 08:29:34 -07:00
Steve Howell cdee3dfb53 Annotate test_helpers.instrument_url(). 2016-09-12 08:21:46 -07:00
Steve Howell ffec98d85c Annotate zerver/lib/export.py.
This adds the remaining annotations to lib/export.py.
2016-09-12 08:21:46 -07:00
Steve Howell 62dd86bcce mypy: Set Path to str instead of text_type in export.py.
Using text_type for Path just breaks a lot of calls to
the core Python libraries that still want strings.
2016-09-12 08:21:46 -07:00
Umair Khan 593779a3b0 Annotate zerver/tests/test_push_notifications.py. 2016-09-12 08:10:50 -07:00
Umair Khan c231a440cd Annotate zerver/templatetags/minified_js.py. 2016-09-12 08:10:50 -07:00
Umair Khan 29c24d540f Annotate zerver/templatetags/app_filters.py. 2016-09-12 08:10:50 -07:00
Umair Khan b4eb3a55be Annotate zerver/management/commands/realm_emoji.py. 2016-09-12 08:10:50 -07:00
Umair Khan f8c904e611 Annotate zerver/management/commands/deliver_email.py. 2016-09-12 08:10:50 -07:00
Umair Khan c096473e06 Annotate zerver/management/commands/check_redis.py. 2016-09-12 08:10:50 -07:00
Steve Howell 64cb5d0778 Annotate commands/export.py. 2016-09-11 17:15:35 -07:00
Steve Howell 52c6efa0a8 Annotate commands/export_single_user.py. 2016-09-11 17:15:35 -07:00
Steve Howell bb6fcaa4e7 Annotate commands/export_usermessage_batch.py. 2016-09-11 17:15:35 -07:00
Steve Howell 85e30a6d35 Annotate commands/import.py. 2016-09-11 17:15:35 -07:00
Steve Howell 43572486b2 Annotate test_export.read_file(). 2016-09-11 17:15:35 -07:00
Steve Howell 30129f609b Annotate client_post() and client_get() in test_helpers. 2016-09-11 17:15:35 -07:00
Tomasz Kolek 8b9e9a386a Add mypy annotations to various integrations-related functions.
Added to:
zerver/lib/integrations.py
zerver/tests/test_integrations.py
zerver/tests/test_management_commands.py
zerver/views/integrations.py
zerver/views/webhooks/circleci.py
2016-09-11 17:11:25 -07:00
Tim Abbott 8fbbb3a471 Annotate send_password_reset_email.py. 2016-09-11 17:09:27 -07:00
Tim Abbott 4634aa638e Annotate zerver/lib/tornado_ioloop_logging.py. 2016-09-10 12:10:41 -07:00
Tim Abbott 799c78fbcf Annotate zerver/lib/sqlalchemy_utils.py. 2016-09-10 12:08:37 -07:00
Tim Abbott 2e6aad669c cache: Add a basic annotation for cache_with_key. 2016-09-10 11:57:08 -07:00
Tim Abbott 83ef7e72e6 models: Fix missing mypy annotations in subdomains code. 2016-09-10 11:57:07 -07:00
Tim Abbott 3a64074e8b test_signup: Annotate some recently added functions. 2016-09-10 11:57:07 -07:00
Tim Abbott e48cdb8d7e Fix python 3 compatibility in logging code.
Detected by mypy.
2016-09-09 15:36:29 -07:00
Tim Abbott b41fc75767 notifications: Remove unused field from template context.
While one often might want to put the user's name in an email
template, `name` here was the user's full name, not their first name,
and thus reads as quite formal.
2016-09-08 17:03:00 -07:00
Tim Abbott 0d324d38b3 logging: Fix duplicate detection for email errors.
Our implementation of duplication detection in the Zulip email error
reporting system was buggy in two important ways:

* It did not look at the traceback, and thus considered all errors as
  the same.

* It reset the 10-minute duplicate timer every time an error happened,
  thus concealing situations where the same error was occuring more
  often than 1/10 minutes.
2016-09-08 16:55:36 -07:00
Tim Abbott 4423222d92 email_mirror: Add successful processing logging. 2016-09-08 16:54:10 -07:00
Tim Abbott a7fe22f4ec Add Zulip version number to page_params. 2016-09-08 15:29:24 -07:00
Tomasz Kolek 848635005f Add Sentry integration.
Fixes: #618.
2016-09-07 19:39:45 -07:00
ashishk1994 329f52668d Add test_set_color_unsubscribed_stream_name.
Signed-off-by: ashishk1994 <ashishk.iiit@gmail.com>
2016-09-07 19:10:12 -07:00
Ashish Kumar c9b81379b6 Add test_bot_add_subscriptions().
Signed-off-by: ashishk1994 <ashishk.iiit@gmail.com>
2016-09-07 19:10:12 -07:00
Umair Khan 6a12ad7c33 Don't trust env while accessing Tornado.
This fixes a problem where the requests to Tornado would attempt to
use a configured outgoing HTTP proxy, when really we want to connect
directly to localhost.

Fixes: #468.
2016-09-06 14:17:50 -07:00
Umair Khan a4466c93a3 Use connection pooling for Django -> Tornado reqs.
Fixes: #391.
2016-09-06 14:15:35 -07:00
Tim Abbott 0e5926ea02 tests: remove full database query pgroonga test.
This test seemed to be occasionally flaky (with the query changing by
1 character), and it's not clear it had a lot of value in the first
place.
2016-08-27 10:25:42 -07:00
Tomasz Kolek 0e192d6aff Add colors to streams in development server fixtures.
Fixes: #1454.
2016-08-26 22:38:14 -07:00
Kouhei Sutou 683f49aa99 Support full text search for all languages using pgroonga.
This adds support for using PGroonga to back the Zulip full-text
search feature.  Because built-in PostgreSQL full text search doesn't
support languages that don't put space between terms such as Japanese,
Chinese and so on. PGroonga supports all languages including Japanese
and Chinese.

Developers will need to re-provision when rebasing past this patch for
the tests to pass, since provision is what installs the PGroonga
package and extension.

PGroonga is enabled by default in development but not in production;
the hope is that after the PGroonga support is tested further, we can
enable it by default.

Fixes #615.

[docs and tests tweaked by tabbott]
2016-08-26 21:04:03 -07:00
Rishi Gupta 084bc63cad Change Day 2 email to be sent 24 hours after the user signs up.
Old behavior is to do something tricky that relies on the server being on
Pacific Time and the users being in the US. The goal is to have this message
appear during business hours, since click through rates are higher during
business hours. Our server is now on the East Coast though and our users are
in every timezone, so until we do something smarter this seems like a better
heuristic. We're also trying to cleanse our codebase of non-timezone-aware
datetime.datetime objects.
2016-08-26 15:59:30 -07:00
Tomasz Kolek 69a9fece70 Add GitLab integration.
Fixes: #33.
2016-08-25 13:49:51 -07:00
Vishnu Ks a7ead9e99d settings: Eliminate ADMIN_DOMAIN for creating initial realm.
We now use `./manage.py generate_realm_creation_link` as the flow flow
for creating one's first realm.
2016-08-25 09:37:33 -07:00
Tim Abbott 5b68e0defe settings: Fix buggy MANDRILL_API_KEY logic. 2016-08-25 09:37:33 -07:00
Tim Abbott a90b470205 Fix regression in search interaction with wide unicode characters.
Apparently, we had incorrectly concluded that our highlight_string
search result highlighting offsets coming from tsearch_extras were
measured in bytes, whereas in fact it is measured in characters.
2016-08-25 09:04:29 -07:00
Tim Abbott 797a7ef97b notifications: Don't spoof emails as from users by default.
The previous default configuration resulted in delivery problems if
the Zulip server was authorized in the SPF records for the domains of
all users on the Zulip server.
2016-08-24 14:10:52 -07:00
Rishi Gupta 4bfac78303 Refactor /integrations page links to support subdomains.
Also changes all links to /integrations to be relative rather than
absolute, so that users will primarily access the /integrations page
for their subdomain.
2016-08-22 22:39:53 -07:00
Tim Abbott e3affe96a5 subdomains: Use subdomain host in password reset emails. 2016-08-22 22:39:52 -07:00
Tim Abbott 2b0a486077 Eliminate cross-realm PM conversation with ADMIN_DOMAIN.
In the future, we can use UserProfile.is_staff to control this, but
there isn't a current use case for it.
2016-08-22 21:46:16 -07:00
Tim Abbott 3bdbc33e94 initialize_voyager_db: Fix zulip.com hardcoding. 2016-08-22 21:36:15 -07:00
Tim Abbott 55d7947b76 email_mirror: Use ERROR_BOT for error reporting.
This has the nice side effect of getting rid of the now-unnecessary
ADMIN_DOMAIN from this codepath -- we really just want whichever
realm ERROR_BOT is in.
2016-08-22 21:28:01 -07:00
Steve Howell cd2e36d66f export: Add lib.utils.query_chunker(). 2016-08-22 19:27:32 -07:00
Steve Howell fd6ee7117f tests: Renamed AuthedTestCase to ZulipTestCase. 2016-08-22 19:07:44 -07:00
Tim Abbott 95fbd5ba31 Update zulip.com/integrations link to point to zulipchat.com.
zulip.com will stop running at some point in the near future, and we
don't want these links to break.
2016-08-22 17:26:41 -07:00
Tim Abbott 96a5388fcb mandrill: Fix hardcoded check for settings.VOYAGER.
Since this delayed sending feature is the only thing
settings.MANDRILL_API_KEY is used for, it seems reasonable for that to
be the gate as to whether we actually use Mandrill.
2016-08-22 16:25:28 -07:00
Tim Abbott e1e384acc0 realm_emoji: Fix management command usage output. 2016-08-19 11:59:38 -07:00
Taranjeet Singh eef1d78e68 bitbucket2.py: Fix line with length greater than 120.
This updates file zerver/views/webhooks/bitbucket2.py.
2016-08-19 11:56:43 -07:00
Taranjeet Singh 57253c6ba3 makemessages.py: Fix line with length greater than 120.
This updates file zerver/management/commands/makemessages.py.
2016-08-19 11:56:43 -07:00
Taranjeet Singh 5e5ad9de0c bugdown/__init__.py: Fix line with length greater than 120.
This updates file zerver/lib/bugdown/__init__.py.
2016-08-19 11:56:43 -07:00
Tim Abbott 399f4f8870 Add management command to send password reset emails.
This is a convenient tool to have around.

We require an unusual argument value of "YES" to send to everyone on
the server, since that's something one should do with a great deal of
care.
2016-08-18 20:12:36 -07:00
Rishi Gupta 64179b2fd2 confirmation: Use realm host in activation URLs.
This is preparation for merging the subdomains feature.
2016-08-18 20:12:36 -07:00
Tim Abbott b8050ce02f Add realm.host property. 2016-08-18 18:48:40 -07:00
Tim Abbott 7950d3181e zmirror: Fix hardcoding of zulip.com support email address.
We now use support_email == settings.ZULIP_ADMINISTRATOR just like
every other support email address reference.
2016-08-18 18:36:07 -07:00
Tim Abbott e0432f21f1 Move webathena views to its own file. 2016-08-18 18:26:49 -07:00
Tim Abbott 05d3094420 webathena: Remove hardcoding of zulip.com server. 2016-08-18 18:21:38 -07:00
Brock Whittaker 6936d49202 Live update new avatars across users.
This sends an event when a new avatar is uploaded that refreshes the
avatar for all browser clients without the need to reload the browser.

Fixes: #1359.
2016-08-18 15:32:29 -07:00
Tim Abbott e7aac717e8 Fix markdown ordering bugs with some custom syntax.
!avatar, !modal_link, !gravatar, etc. were incorrectly being processed
before the escape character for code blocks.

While we're at it, we add tests for these special syntaxes.
2016-08-18 14:47:37 -07:00
Steve Howell 552a6dc017 tests: Add DocPageTest. 2016-08-18 13:28:58 -07:00
Steve Howell d1c34a6618 tests: Fix test_create_user_backend().
It was passing in a UserProfile object to client_put(),
which is unnecessary and can break the url coverage
report.
2016-08-18 13:28:58 -07:00
Steve Howell 125dcad379 tools: Report OverflowErrors in url coverage report. 2016-08-18 13:28:58 -07:00
Tim Abbott 685d63b6cc notifications: Update digest email link URLs to use realm.uri.
This is preparation for fully supporting each realm having its own
subdomain in Zulip.
2016-08-17 22:58:35 -07:00
Tim Abbott 91ad923d80 notifications: Use realm.uri in unsubscribe links. 2016-08-17 22:44:38 -07:00
Tim Abbott 48ed7e2e31 notifications: Use realm_uri for click here link. 2016-08-17 22:19:53 -07:00
Tim Abbott 5f12136e7c notifications: Fix broken one click unsubscribe link. 2016-08-17 22:19:53 -07:00
Tim Abbott 6ef79ac66c notifications: Remove support@zulip.com comment in docstring. 2016-08-17 22:19:53 -07:00
Tim Abbott c5fb6dfcb8 TOS: Fix forcing users to double-accept terms of service. 2016-08-17 22:19:53 -07:00
Tim Abbott f0a65fe52a export_messages_single_user: Fix missing order_by.
This fixes a nasty bug where exporting messages sent by a single user
might only contain some of the messages in the event that the
unspecified sort order by the database didn't happen to be sorted by
message ID.
2016-08-17 22:18:58 -07:00
Steve Howell c12bd853f7 export: Add basic export tests. (fixes #1584) 2016-08-16 13:38:37 -07:00
Steve Howell ab053845aa export: Fetch messages with two queries. 2016-08-16 13:38:37 -07:00
Steve Howell a5f651b81a export: Add some user_id filtering to do_export_realm().
This commit only addresses tables that currently derive from
user_profile_config in get_realm_config:

   zerver_userpresence
   zerver_useractivity
   zerver_useractivityinterval
   zerver_subscription
   zerver_recipient
   zerver_stream
   zerver_huddle

It also introduces an entry in realm.json for a virtual
table called "zerver_userprofile_mirrordummy" for dummy users,
which include prior dummy users and users excluded from the call
to do_export_realm().

Note that this feature is not yet exposed in the management command.
2016-08-16 13:38:37 -07:00
Tim Abbott bfa987f26e Add missing realm_uri and server_uri to HomeTest. 2016-08-13 16:52:56 -07:00
Tim Abbott 5cad3f5707 handlebars: Add server_uri and realm_uri to page_params. 2016-08-13 16:27:36 -07:00
Tim Abbott 4fbb8c3eee templates: Add new context variables to all templates.
This adds a few new helpful context variables that we can use to
compute URLs in all of our templates:
* external_uri_scheme: http(s)://
* server_uri: The base URL for the server's canonical name
* realm_uri: The base URL for the user's realm

This is preparatory work for making realm_uri != server_uri when we
add support for subdomains.
2016-08-13 16:27:35 -07:00