Tomasz Kolek
f0cc6d8029
Adjust Taiga integration to new payloads format.
...
Update all payloads.
Remove move task between User stories events.
Update code to handle new payload format.
Fixes : #2318 .
2017-01-11 14:17:44 -08:00
Rishi Gupta
b22f574224
Re-write models.get_realm to use Django convenience function.
2017-01-10 23:18:26 -08:00
Tim Abbott
007d4becfd
Revert "update-sockjs: Update sockjs from version 0.3.4 to 1.1.1."
...
This reverts commit 7bf10ec74f
.
Apparently, SockJS 1.1.1 is broken with the browser used in our legacy
desktop app, resulting in messages being silently not sent.
2017-01-10 11:46:15 -08:00
Bojidar Marinov
786dd0fca4
auth: Make min password length and strength configurable.
...
This adds some configuration options to settings.py, namely
PASSWORD_MIN_LENGTH and PASSWORD_MIN_QUALITY, which control
when the frontend validator invalidates the password.
Closes #2628
2017-01-10 04:55:41 -08:00
Tim Abbott
3f8d4193da
lint: Fix % comprehensions being used without a tuple.
2017-01-09 11:45:11 -08:00
Rishi Gupta
494c1a2b55
Remove unnecessary uses of Realm.domain in zerver/tests.
2017-01-09 11:26:08 -08:00
Tommy Ip
008663abd8
zerver: Fix bare except clause.
2017-01-09 00:38:31 +00:00
Tommy Ip
89a126b93f
zerver: Fix bare except clause.
2017-01-08 16:22:21 -08:00
Tim Abbott
f3b5683e77
views: Rename __init__.py to zerver.views.registration.
...
This completes the cleanup process of eliminating functions in the
root zerver/views/__init__.py module.
2017-01-08 16:21:15 -08:00
Tim Abbott
48f1b4e1ab
views: Extract zerver.views.muting.
2017-01-08 16:21:15 -08:00
Tim Abbott
7beff88f5f
views: Extract zerver/views/home.py.
...
This is a significant piece of the remaining effort required to
eliminate the catch-all zerver/views/__init__.py.
2017-01-08 16:21:15 -08:00
Tim Abbott
46fc136943
feedback-bot: Add logging for successfully submitted feedback.
2017-01-06 21:42:16 -08:00
Rishi Gupta
38c2dc8790
Change settings.SYSTEM_ONLY_REALMS to use Realm.string_id.
2017-01-06 19:45:08 -08:00
Rishi Gupta
89af775e03
test_classes: Remove domain from ZulipTestCase.register.
2017-01-06 19:45:08 -08:00
Rishi Gupta
021c65a656
test_classes: Remove domain from ZulipTestCase.submit_reg_form_for_user.
2017-01-06 19:45:08 -08:00
Harshit Bansal
ceb636dbd9
Manage allowed domains from admin settings.
...
Fixes : #1867 .
2017-01-06 12:03:31 -08:00
Umair Khan
6dc8d5c39e
Fix transaction issue in huddle creation.
...
Previously, huddles were created outside of a transaction (and then
the actual initialization of the huddle object was done inside). This
made the huddle visible to other threads of execution while the
related data was still invisible due to transaction commit latency.
2017-01-06 10:54:06 -08:00
Rishi Gupta
3514040d2e
tests.py: Rename FindMyTeamTestCase to TestFindMyTeam.
2017-01-06 10:42:28 -08:00
Rishi Gupta
fdb47fc5ee
find my team: Canonicalize URL route.
...
Change URL endpoint to use underscores, not dashes, and change name to use
the full path to the view function. See e.g. /create_realm.
2017-01-06 10:42:28 -08:00
Rishi Gupta
757297b72f
Move find_my_team functions out of views/auth.py
...
The general __init__ file is a more natural home, and where other endpoints
(e.g. create_realm, etc) live.
Also changes forms.ValidationError to django.core.exceptions.ValidationError
to match the rest of the file/codebase.
2017-01-06 10:42:28 -08:00
Rishi Gupta
0039689acb
find team flow: Update text in emails and templates.
2017-01-06 10:42:28 -08:00
Rishi Gupta
e481fef9e1
Move find_team_email subject to a templates/ file.
2017-01-06 10:42:28 -08:00
Rishi Gupta
7cb5d26999
Rename find_team_email_html.txt to find_team_email.html.
2017-01-06 10:42:28 -08:00
Rishi Gupta
f5d5b2525c
notifications.py: Change email template file endings from .text to .txt.
...
We use .txt for all other emails (i.e. ones that don't go through
notifications.py) in the codebase.
2017-01-06 10:42:28 -08:00
Rishi Gupta
8a07545afb
Rename digest_email_txt.html to digest_email.html.
...
The .html file ending is clearer and more in line with our other
email files.
2017-01-06 10:42:28 -08:00
Rishi Gupta
8d038eef2f
digest emails: Move the subject line to a templates/ file.
...
To match how we do the subject line for the emails in followup/ and
invitation/.
2017-01-06 10:42:28 -08:00
Rafid Aslam
88ec999cf3
tests: Bump up max length queries in test_bulk_message_fetching().
...
Bump up max length queries in `test_bulk_message_fetching()` to 11
in `zerver/tests/test_messages.py` to avoid test failing when run
this test alone.
Fixes #3087 .
2017-01-05 17:30:47 -08:00
Brock Whittaker
b976e179e6
css: Restyle Open-Graph Links.
...
This styles open-graph links to be cleaner and smaller.
2017-01-05 16:15:01 -08:00
Steve Howell
99b5c00ec1
Add stream id to message dictionary.
...
We now pass the stream id in the messages we send to
our clients.
2017-01-05 15:32:45 -08:00
Bojidar Marinov
5fc65efd69
messages: Allow rendering message content without having an actual message.
...
This is useful for doing rendering in the emoji search code path.
2017-01-05 15:16:43 -08:00
Jackson
032b5e9db9
integrations: Add webhook code, API endpoint, and tests for Delighted.
2017-01-05 10:47:30 -08:00
Vamshi Balanaga
1b2472b5cb
integrations: Modify solano labs integration.
...
This adds support for the "running" status and adds a test fixture.
2017-01-05 10:19:32 -08:00
Tomasz Kolek
6d1cb44bd4
bitbucket2: Add additional debugging info about unsupported keys.
2017-01-04 17:29:49 -08:00
Rishi Gupta
2b0a7fd0ba
Rename models.get_realm_by_string_id to get_realm.
...
Finishes the refactoring started in c1bbd8d
. The goal of the refactoring is
to change the argument to get_realm from a Realm.domain to a
Realm.string_id. The steps were
* Add a new function, get_realm_by_string_id.
* Change all calls to get_realm to use get_realm_by_string_id instead.
* Remove get_realm.
* (This commit) Rename get_realm_by_string_id to get_realm.
Part of a larger migration to remove the Realm.domain field entirely.
2017-01-04 17:12:23 -08:00
Umair Khan
f208813ea3
Add Find My Team feature.
2017-01-03 21:33:42 -08:00
Vamshi Balanaga
234310bfd1
integrations: Add webhook code, API endpoint, and tests for solano labs.
2017-01-03 20:18:34 -08:00
Vamshi Balanaga
d6b551d508
integrations: Add webhook payloads for solano labs
2017-01-03 20:18:34 -08:00
Rishi Gupta
cf762eaf84
Change X.realm.id to X.realm_id across codebase.
...
This makes it more clearly the pattern in the Zulip codebase, and thus
decreases the risk of accidentally doing database queries.
2017-01-03 16:46:26 -08:00
Rishi Gupta
caccf8ee17
Remove models.get_realm(domain).
2017-01-03 16:46:15 -08:00
Rishi Gupta
130f981901
messages.send_message_backend: Take a realm_str instead of a domain.
2017-01-03 16:46:15 -08:00
Rishi Gupta
b206d6f251
message.py: Change domain to realm_id in render_markdown args.
2017-01-03 16:46:14 -08:00
Rishi Gupta
c6e12e74be
Change domain to realm_id in bugdown and realm filter dicts and caches.
2017-01-03 16:25:20 -08:00
Rishi Gupta
be6f54d7bb
messages.py: Add sender.realm.id to MessageDict.
2017-01-03 16:25:20 -08:00
Rishi Gupta
50d67d9a13
test_messages: Add warning about running test_bulk_message_fetching alone.
...
Running this test fails if it is not run as a part of the larger
test_messages suite. This commit adds a comment to that effect.
2017-01-03 16:25:20 -08:00
Jackson
29ce856843
Clean PUT /users/me/pointer to POST /users/me/pointer.
2017-01-03 15:43:11 -08:00
Jackson
0a9869868c
Clean PUT /users to POST /users
2017-01-03 15:40:00 -08:00
Jackson
6ec8abab86
Clean PUT /default_streams to POST /default_streams.
2017-01-03 15:40:00 -08:00
Tim Abbott
3a9a6308fd
Fix per-user database queries for emoji reactions.
...
This was a classic database-queries-in-loop bug.
2017-01-03 10:53:26 -08:00
anirudhjain75
5f4a822655
mypy: Annotate zerver/tests/test_decorators.py.
2017-01-02 08:59:49 -08:00
Tim Abbott
a61386cbbc
github: Fix GitHub integration CSRF issue.
...
The new GitHub dispatcher integration was apparently totally broken,
because we hadn't tagged the new dispatcher endpoint as exempt from
CSRF checking. I'm not sure why the test suite didn't catch this.
2016-12-30 20:31:08 -08:00
Tim Abbott
5c0730d7ca
reactions: Fix check for valid emoji.
...
The previous logic did not correctly handle the case where there were
realm emoji (non-realm emoji would be inaccessible).
2016-12-30 17:51:31 -08:00
Tim Abbott
8d66a4f53f
test_signup: Fix test failure due to user docs include/.
2016-12-30 17:46:55 -08:00
Tim Abbott
687d0cbf9e
docs: Add support for including markdown files in others.
...
This uses a third-party dependency, python-markdown-include.
The example use for settings is intended primarily as a demonstration.
2016-12-30 17:16:29 -08:00
Umair Khan
b6cb6a4f0c
ldap: Inherit FakeLdap exceptions from ldap.
2016-12-30 16:55:06 -08:00
K.Kanakhin
0d8c18a6dd
nagios-plugins: Add websocket checking to nagios message sending test.
...
- Add websocket client to create connection with SockJS websocket server.
It contains callback method to launch after connection setup.
- Add '--websocket' parameter to 'check_send_receive_time' script to
check websocket connection.
- Add testing websocket connection to production installation checking.
- Add cronjob to launch websocket connection nagios test.
This makes it possible for Zulip Nagios monitoring to check for
problems impacting the websockets sending code path, which is what all
web users use.
2016-12-30 15:36:37 -08:00
Tim Abbott
0ddaa13eeb
lint: Fix indentation error in user_settings.py.
2016-12-30 14:31:04 -08:00
Jackson
aeac3848c8
integrations: Add webhook code, API endpoint, and tests for HelloSign.
2016-12-30 14:19:31 -08:00
Prabod Rathnayaka
6f087e468e
Add setting hiding private message content in desktop notifications.
...
Tweaked by tabbott to fix a refactoring bug, set the default to True,
fix the real-time sync, and add tests for this.
Fixes #2355 .
2016-12-30 14:10:34 -08:00
Vamshi Balanaga
bf71ad162c
Update Google Calendar Integration.
...
Update integration to use the latest Google API client.
Move Google Account authorization code to a separate file.
Move relevant files from 'bots/' to 'api/integrations/google/'.
Add documentation for integration.
2016-12-30 12:01:31 -08:00
Tim Abbott
b36e94c954
bugdown: Blacklist linkifying the .md TLD.
...
Fixes #2065 .
2016-12-29 18:17:50 -08:00
Rishi Gupta
674f068b92
Script to add all current Zulip users to a mailchimp list.
2016-12-29 16:24:40 -08:00
Rishi Gupta
13d1a636d5
queue_processors.SignupWorker: Upgrade to MailChimp API v3.0.
...
Removes the dependence on postmonkey, which is a wrapper around
MailChimp API v1.3. MailChimp recommends using their v3.0 API directly,
rather than through a wrapper library.
2016-12-29 16:16:18 -08:00
Rishi Gupta
c61938f719
SignupWorker: Use dictionary indexing instead of get for name and email.
...
We always pass in EMAIL in data, and NAME in merge_vars.
2016-12-29 16:16:18 -08:00
Rishi Gupta
823659848c
Change UserProfile.enter_sends to default to False.
...
Adds a database migration.
2016-12-29 15:55:23 -08:00
Tim Abbott
0847515203
Fix text_type->Type mypy merge conflict error.
2016-12-29 15:03:37 -08:00
Rishi Gupta
9e5325a164
Add /stats page with basic stats graph.
...
Adds a new url route and a new json endpoint.
2016-12-29 14:20:13 -08:00
Rishi Gupta
7b057392c6
decorator.py: Add to_utc_datetime converter function.
2016-12-29 14:20:13 -08:00
Rishi Gupta
40529cdd14
timestamp.py: Add {floor,ceiling}_to_{hour,day} to parallel floor_to_day.
2016-12-29 14:20:13 -08:00
Juan Verhook
cfa9c2eaf2
mypy: Update zerver directory to use Text
2016-12-29 09:12:15 -08:00
Steve Howell
3d804de962
Fix FeedbackBot queue processor.
...
Recent changes to the API removed Client.register(), and
this change restores the correct API call, although the
codepath this affects is probably ready for eventual
deprecation.
2016-12-28 12:12:34 -08:00
Tim Abbott
b677d63ed7
mypy: Fix missing class in request.pyi and document.
2016-12-28 09:37:28 -08:00
Harshit Bansal
9931ad1324
Loosen realm filter pattern validator to support Git commit IDs.
...
Specify, we no longer require a prefix.
Also improves the clarity of the examples in the documentation.
Fixes : #2696 .
2016-12-27 20:31:08 -08:00
Tim Abbott
39f0ffdedd
Move static/third/gemoji to static/generated/emoji.
...
Fixes #1153 .
2016-12-27 20:16:23 -08:00
Tim Abbott
f46d99ba85
lint: Remove zerver/migrations from main exclude list.
2016-12-27 19:45:33 -08:00
Tim Abbott
fa2aa42b03
do_invite_users: Avoid creating broken PreregistrationUser objects.
...
While this may not have created a clear user-facing bug, it seems less
confusing for do_invite_users to only create PreregistrationUser
objects for users who actually received an email invitation.
2016-12-27 17:14:21 -08:00
Bojidar Marinov
9682d26561
invite: Leave not yet invited users in the invite modal's textarea.
...
Also, make zerver tell us whether invitations were sent.
Fixes #2287 .
2016-12-27 17:14:21 -08:00
Tomasz Kolek
56f530331d
Add default topics mechanism to stripe integration.
...
Fixes : #2586 .
2016-12-27 16:27:54 -08:00
Tomasz Kolek
02bf4646fc
Refactor transfer part of stripe integration.
2016-12-27 16:27:54 -08:00
Tomasz Kolek
6dca1ecc40
Refactor order part of stripe integration.
2016-12-27 16:27:54 -08:00
Tomasz Kolek
a75d94d3cf
Refactor invoice part of stripe integration.
2016-12-27 16:27:54 -08:00
Tomasz Kolek
e843af5d27
Refactor customer part of stripe integration.
2016-12-27 16:27:54 -08:00
Tomasz Kolek
d1c486b8e9
Refactor charge part of stripe integration.
2016-12-27 16:27:54 -08:00
paxapy
8e7fa6b2de
emoji: Add add_emoji_by_admins_only realm setting.
...
This setting controls whether normal users can add realm emoji.
Fixes #978 .
2016-12-27 15:46:14 -08:00
Igor Tokarev
1238d08f72
emoji: Add emoji author data in API.
2016-12-27 15:42:21 -08:00
Igor Tokarev
ffa724f8fc
emoji: Add author field to RealmEmoji table and track.
2016-12-27 15:42:04 -08:00
Rishi Gupta
717afcb408
Remove calls to get_realm in preparation for its deprecation.
...
Also removes two calls to email_to_domain.
2016-12-26 17:53:32 -08:00
Rishi Gupta
e9a6bd1986
Change register/<domain>/ URL route to register/<realm_str>/.
2016-12-26 17:51:00 -08:00
Rishi Gupta
ea64b18f91
zerver.views: Be confident that request.session['domain'] is valid.
...
We only write domain to the session variable in one place,
accounts_home_with_domain, where we check that the domain is valid, that the
domain corresponds to an open realm, and that we are in the non-subdomains
case.
Previously, we were confusingly checking only a subset of the conditions
on reading back the domain in create_preregistration_user, and not checking
any of them when reading back the domain in get_realm_from_request.
2016-12-26 17:50:46 -08:00
Rishi Gupta
d6e7014f06
Refactor views.create_homepage_form into its callers.
...
The indirection is no longer that useful, and obscures Django's conventional
style for calling a form.
2016-12-26 17:50:23 -08:00
Rishi Gupta
146f2ca482
Refactor get_realm_from_request out of views.create_homepage_form.
2016-12-26 17:49:58 -08:00
Rishi Gupta
1ce9a8a458
Remove confusing comments in HomepageForm and RealmCreationForm.
2016-12-26 17:49:58 -08:00
Rishi Gupta
ddf480136c
Remove unused domain argument from RealmCreationForm.
2016-12-26 17:49:58 -08:00
Rishi Gupta
ec658d038d
Refactor HomepageForm to use a Realm instead of a string_id.
2016-12-26 17:49:58 -08:00
Rishi Gupta
ea634cb982
forms: Refactor HomepageForm to be more pythonic.
2016-12-26 17:49:58 -08:00
Rishi Gupta
a87e653c32
Refactor models.completely_open to take a Realm instead of a domain.
2016-12-26 17:49:58 -08:00
Rishi Gupta
05abca0848
name_restrictions: Add a few more reserved subdomains.
2016-12-26 14:59:09 -08:00
Rishi Gupta
73a77e2da8
integrations: Fix spelling of mailchimp.
2016-12-26 14:59:09 -08:00
Juan Verhook
535ce90272
mypy: Convert zerver/views to use typing.Text.
2016-12-26 13:43:09 -08:00
Robert Hönig
ef3069a5d3
mypy: Convert the isinstances function in /zerver/lib/ to use typing.Text.
2016-12-25 10:33:45 -08:00
Robert Hönig
0917493588
mypy: Convert zerver/lib to use typing.Text.
2016-12-25 10:33:45 -08:00
Rafid Aslam
d0502537ab
API: Migrate POST `/ui_settings/change` to PATCH `/settings/ui`
2016-12-24 11:02:02 -08:00
Juanvulcano
2fd1316d70
Removed json/update_message
...
Update test_alert_words.py
Update test_messages.py
Update messages.py
2016-12-24 10:08:22 -08:00
JefftheBest1
b8ee0e91d2
Migrated json/subscribtions/remove to REST endpoint
2016-12-24 09:27:25 -08:00
Jackson
3a109a56df
Migrate notify_settings to settings/notifications
...
Remove notify_settings from legacy_url.py
2016-12-24 09:24:23 -08:00
anirudhjain75
8acdbef8aa
Eliminate legacy json/make_stream_public and json/make_stream_private URL
...
Migrate from POST to PATCH
2016-12-24 08:54:49 -08:00
Sampriti Panda
39dde79ab8
tests: Improve argument name in check_for_toggle_param_patch
2016-12-24 08:38:33 -08:00
Sampriti Panda
87e7dc6799
urls: Remove legacy URL for left_side_userlist and move over to REST PATCH endpoint
2016-12-24 08:38:33 -08:00
Jackson
333cf0f015
Migrate legacy /json/time_setting to new REST style endpoint.
2016-12-23 08:08:27 -08:00
Tommy Ip
1e0de94293
API: convert get_subscribers from legacy URL to REST endpoint.
2016-12-22 09:25:12 -08:00
Tim Abbott
7d99380488
update_display_settings: Move validation to beginning.
...
This makes the function more friendly for adding additional
functionality to.
2016-12-22 06:58:53 -08:00
Tim Abbott
0299f41c80
settings: Extract update_display_settings_backend.
2016-12-22 06:57:06 -08:00
anirudhjain75
c9db6b6658
Clean up legacy language_settings endpoint.
2016-12-22 06:54:04 -08:00
Tim Abbott
5cd6ff20b0
models: Fix bare except clause.
2016-12-22 06:46:43 -08:00
Sampriti Panda
425a55e568
settings: Implement delete avatar functionality
2016-12-21 13:35:22 -08:00
Sampriti Panda
e72cd0b1cc
urls: convert set_avatar from legacy URL to REST endpoint
2016-12-21 13:35:22 -08:00
Sampriti Panda
567fab1137
tests: Add client_put_multipart to allow for file uploads using PUT
2016-12-21 13:35:22 -08:00
Rafid Aslam
bfe84a10f0
API: Migrate POST `json/fetch_raw_message` to GET `json/messages/<id>`
2016-12-21 13:08:40 -08:00
Tim Abbott
753a25268c
help: Enable and use the markdown admonition extension.
...
This allows us to add warnings and tips in the Zulip help documents.
2016-12-21 11:01:49 -08:00
Jackson
59eb7a54e2
integrations: Add documentation for GoSquared.
2016-12-20 16:59:36 -08:00
Jackson
4ff4f12aea
integrations: Add webhook code, API endpoint, and tests for GoSquared.
2016-12-20 16:59:36 -08:00
Rafid Aslam
e49bd6a6c7
event_queue: Improve error message for ConnectionError exception
...
Improve error message for "ConnectionError:
HTTPConnectionPool(host='localhost', port=9993): Max retries
exceeded" exception.
Fixes #215 .
2016-12-20 11:49:12 -08:00
Tim Abbott
7f7cae332b
logging: Fix handling of tracebacks with no exc_info.
2016-12-20 11:49:12 -08:00
Rafid Aslam
5cc8838df4
tests: Add `assert_url_serves_contents_of_file()` to `ZulipTestCase`
...
Add `assert_url_serves_contents_of_file()` in `ZulipTestCase` class
and deduplicate some codes.
Fixes #1276 .
2016-12-20 08:06:22 -08:00
Rafid Aslam
64f595b061
tests: Add test about avatar image was uploaded properly or not
...
Add test about avatar image was uploaded properly or not in
`tests.BotTest.test_add_bot_with_user_avatar` and
`tests.BotTest.test_patch_bot_avatar`.
Add `get_test_image_file()` and `avatar_disk_path()` in
`zerver.lib.test_helpers` and deduplicate some codes.
Fixes #1276 .
2016-12-20 08:06:22 -08:00
Sampriti Panda
c0326d1938
Add lint rule to disallow python calls with versions (e.g: python2, python3)
...
Fixes #2435
2016-12-19 08:00:48 -08:00
K.Kanakhin
bae5afe458
Initialize markdown extensions once per process instead markdown engine.
...
- Markdow engine is not safe threading as global variable. In some cases
it generates previous markdown templates on concurent requests. It's
enough to generate markdown extensions per process to save time. Also
this solution is thread safe.
2016-12-16 09:04:04 -08:00
Tomasz Kolek
34511065dc
Fix tests problem with backward incompatible function name.
...
Add __init__ methods to some of testing clases with overriding method name.
2016-12-16 07:04:55 -08:00
Umair Khan
7f3fdb2663
Django 1.10: Immediately save session to mitigate race conditions.
2016-12-16 16:24:12 +05:00
paxapy
18e43895ff
streams.py: replace stream_subscribe_button with new #stream syntax.
...
Previously, we included a special subscribe button in new stream
notifications, but that had 2 problems:
(1) The subscribe button would render badly if the stream was renamed.
(2) There wasn't an easy way to look at the stream when deciding
whether to subscribe.
This fixes the second problem, but not really the first.
2016-12-15 22:43:14 -08:00
Tim Abbott
ab8cd37bd8
markdown: Fix performance probelm loading /help/.
...
Apparently, we were running the markdown processor a second time on
the HTML output of the configured markdown processor.
Fixes #2735 .
2016-12-15 21:43:56 -08:00
Tim Abbott
9d6e1030de
test_public_urls: Fix URL coverage instrumentation bug.
2016-12-15 20:58:46 -08:00
Tim Abbott
66bce06a5a
lint: Fix E127 vilations due to recent assertEquals migration.
2016-12-15 20:51:27 -08:00
Tomasz Kolek
bb6d189fa8
Add github dispatcher to have one elegant url for both github integrations.
...
Dispatcher avoids to create new URL for github_webhook.
2016-12-15 17:42:28 -08:00
Tim Abbott
7bf3fb30ea
tests: Remove unnecessary duplicate HelpTest.
...
It had a mysterious performance problem and we have a test for that
code path anyway.
2016-12-15 17:14:36 -08:00
Tim Abbott
bf80873d4f
tests: s/assertRaisesRegexp/assertRaisesRegex/ due to deprecation.
2016-12-15 17:11:42 -08:00
Tim Abbott
6bb959ff4e
url_preview: Fix BeautifulSoup DeprecationWarning.
2016-12-15 17:05:10 -08:00
Tim Abbott
a116c86f62
tests: s/assertEquals/assertEqual/ due to deprecation.
...
Fixes #2730 .
2016-12-15 17:02:03 -08:00
vaibhav
75bf501553
Add optional waiting period for users to create streams.
...
This adds support for only allowing normal users with account age
equal or greater than a "waiting period" threshold to create streams;
this is useful for open organizations that want new members to
understand the community before creating streams.
If create_stream_by_admins_only setting is set to True, only admin users
were able to create streams. Now normal users with account age greater
or equal than waiting period threshold can also create streams.
Account age is defined as number of days passed since the user had
created his account.
Fixes : #2308 .
Tweaked by tabbott to clean up the actual can_create_streams logic and
the tests.
2016-12-15 16:54:30 -08:00
Tomasz Kolek
6fdc026f64
Move get_profile_backend to views/users.py.
...
Fixes : #2710 .
2016-12-15 16:04:23 -08:00
Rishi Gupta
71edcb6490
bulk_create: Refactor bulk_create_users to use more pythonic style.
...
Note: This changes semantics slightly; you now can't call
bulk_create_users with a list of N users containing duplicates and
expect it to work.
2016-12-15 16:00:48 -08:00
Rishi Gupta
fc188de8e0
bulk_create: Refactor bulk_create_users to take Realm instead of domains.
...
Previously bulk_create_users would figure out a user's realm from their
email domain. Now require that a realm be passed explicitly.
2016-12-15 13:22:17 -08:00
Rishi Gupta
84bb73ab65
bulk_create: Clean up ORM calls in bulk_create_streams.
2016-12-15 13:22:17 -08:00
Rishi Gupta
fbf48f7ec6
bulk_create: Refactor bulk_create_streams to not take domain dictionary.
...
First step in cleaning up populate_db.create_streams and
bulk_create.bulk_create_streams. Part of a series of commits to remove
Realm.domain from populate_db.
2016-12-15 13:22:17 -08:00
Umair Khan
c24fbd28b2
Shift to python-gcm for Android push notifications.
...
Fixes #2650
2016-12-15 12:17:07 -08:00
Sampriti Panda
91780180f6
integrations: Add webhook code, API endpoint, and tests for AppFollow
2016-12-15 11:13:27 -08:00
Umair Khan
770a899239
Django 1.10: Use single cache prefix for casper tests.
...
There is a change in Django 1.10 due to which whenever the password
of the user is changed the session hash changes. This change affects
us because we cache user profile objects and these cached objects need
to be refreshed. However, the signal sent by Django in which objects are
refreshed fails to refresh the cache for Tornado because it uses a
different cache prefix.
Note: Backend tests are not affected because they don't rely on Tornado.
2016-12-14 22:40:33 -08:00
Tim Abbott
0b33be50f3
lint: fix some whitespace issues in new reactions code.
2016-12-14 20:37:13 -08:00
Kracekumar R
61d2297c17
Add reactions in the /json/messages endpoint.
2016-12-14 19:21:04 -08:00
Igor Tokarev
f154a3b742
tests: Improve test coverage of templates.
...
Addresses part of #1677 .
2016-12-14 13:08:33 -08:00
Harshit Bansal
dc4e56abae
Show offending stream name incase of a non existent stream.
...
Fixes : #2171 .
2016-12-14 12:17:20 -08:00
Tomasz Kolek
f2319d1b08
Add unittests for receives_offline_notifications function.
...
Fixes #2645 .
2016-12-14 12:03:12 -08:00
Tomasz Kolek
bec9ce755d
Add unittests for receives_online_notifications function.
...
Fixes : #2645 .
2016-12-14 11:49:59 -08:00
Rishi Gupta
92a72f7039
mypy: Use typing.Text in actions.py.
2016-12-14 11:40:34 -08:00
Umair Khan
8e30530cc5
subdomains: Make GitHub login work with subdomains.
...
Fixes #2501 .
2016-12-14 11:09:39 -08:00
Rafid Aslam
78f3fd7999
API: Expose `is_mentioned` in `message` dictionary.
...
Expose `is_mentioned` in `message` dict which contains
boolean value about our account is mentioned in the message
content or not.
This is already available via `flags`, but it seems worth making this
data point more explicit, given its importance in writing bots.
Fixes #2667 .
2016-12-14 10:52:13 -08:00
Rafid Aslam
63c157a22b
API: Expose more information in `get_profile_backend()`
...
Adding more additional information about user profile to
`zerver.views.pointer.get_profile_backend`, like `user_id`,
`full_name`, `email`, `is_bot`, `is_admin`, and `short_name` of the
user.
2016-12-14 10:51:39 -08:00
Tim Abbott
988a2e2d8e
generate_invite_links: Use realm host properly.
2016-12-14 10:46:45 -08:00
Tim Abbott
639dc9108d
set_default_streams: Fix multi-line help output.
2016-12-14 10:40:04 -08:00
reyha
82e32ad255
Access realm by `string_id` in management commands.
...
`Realm.string_id` replaces 'Realm.domain'
in the management commands.
Fixes #2325 .
2016-12-14 10:38:03 -08:00
Umair Khan
c7ec5a14ee
Create redirect_to_main_site function.
...
This function is used in OAuth logins so that we can redirect first to
the root domain (e.g. zulipdev.com if subdomains are *.zulipdev.com).
2016-12-13 21:06:52 -08:00
Tim Abbott
7e8f8551de
decorator: Change /activity to be gated on is_staff.
...
Zulip doesn't previously make use of the standard Django is_staff flag
(in that the Django admin site is disabled), but since conceptually
the /activity page would be part of the Django admin site if we were
using it (i.e. for server-level administrators), it makes sense to key
off of that rather than the previous, fragile, check for the realm
domain name.
2016-12-13 21:06:27 -08:00
Bojidar Marinov
d28f1ddfb4
zerver: Handle `update_global_notifications` in `apply_events`
...
Fixes #2358
2016-12-13 20:20:26 -08:00
reallyly
94b28e0afb
pep8: Fix E128 violations.
...
With some line-wrapping tweaks by tabbott.
2016-12-13 10:50:14 -08:00
Igor Tokarev
fae59502ab
URL preview: Improve test coverage.
2016-12-13 10:43:02 -08:00
Jason Le
67f28fe62d
Speed up rate limiting test in test_external.
...
Patches out the `time.sleep` and mocks the `time.time` to one second
ahead.
Resolves #2239 .
2016-12-09 10:52:11 -08:00
Zac Pullar-Strecker
4eb6adf547
mypy: Annotate zerver/tests/test_narrow.py
2016-12-09 05:48:22 -08:00
Arpith Siromoney
226e3cbf02
Reactions backend: make endpoints more REST-ful.
...
Adding a reaction is now a PUT request to
/messages/<message_id>/emoji_reactions/<emoji_name>
Similarly, removing a reaction is now a DELETE request to
/messages/<message_id>/emoji_reactions/<emoji_name>
This commit changes the url and updates the views and tests.
This commit also adds a test for invalid emoji when removing reaction.
2016-12-07 22:28:02 -08:00
Tomonori Murakami
a9e409a50f
admin: Do not allow removing or deactivating the last org admin.
...
Modified by tabbott to cover and test some additional cases.
Fixes #2396 .
2016-12-07 21:59:33 -08:00
Joy Chen
bfb6ac5fdb
streams: Add default stream description tests and functions.
...
This includes making the default stream description setting into a
dict. That is an API change; we'll discuss it in the changelog but it
seems small enough to be OK.
With some small tweaks by tabbott to remove unnecessary backwards
compatibility code for the settings.
Fixes #2427 .
2016-12-07 21:12:44 -08:00
Joy Chen
dd95a5e03f
streams: Add default stream description population data.
2016-12-07 21:02:17 -08:00
anirudhjain75
beaa62cafa
mypy: Convert several directories to use typing.Text.
...
Specifically, these directories are converted: [analytics/, scripts/,
tools/, zerver/management/, zilencer/, zproject/]
2016-12-07 20:51:05 -08:00
Igor Tokarev
c93f1d4eda
Add oembed/Open Graph/Meta tags data retrieval from inline links.
...
This change adds support for displaying inline open graph previews for
links posted into Zulip.
It is designed to interact correctly with message editing.
This adds the new settings.INLINE_URL_EMBED_PREVIEW setting to control
whether this feature is enabled.
By default, this setting is currently disabled, so that we can burn it
in for a bit before it impacts users more broadly.
Eventually, we may want to make this manageable via a (set of?)
per-realm settings. E.g. I can imagine a realm wanting to be able to
enable/disable it for certain URLs.
2016-12-07 17:40:18 -08:00
Tim Abbott
b68fef8933
actions: Extract update_to_dict_cache.
2016-12-07 17:26:16 -08:00
Rafid Aslam
b621817194
test_public_urls: Automate test files (in templates/zerver/help/).
...
This automates including of markdown files under
`templates/zerver/help/` to be tested by `test_public_urls` (in
zerver/tests/test_signup.py).
Fixes #2465 .
2016-12-07 11:25:22 -08:00
Sampriti Panda
7c3aff92d9
integrations: Add webhook payloads, webhook code, API endpoint, and tests for heroku
2016-12-06 11:05:00 -08:00
root
20a55ea6e0
integrations: Add webhook payloads for appfollow.
2016-12-05 23:48:00 -08:00
Zac Pullar-Strecker
e6e11aefb3
settings: Add option to disable websockets.
...
This can be useful in scenarios where the network doesn't support
websockets. We don't include it in prod_settings_template.py since
it's a very rare setting to need.
Fixes #1528 .
2016-12-05 21:55:22 -08:00
Bickio
84765e48a9
integrations: Add webhook code, API endpoint, and tests for papertrail
2016-12-05 21:48:11 -08:00
K.Kanakhin
7bf10ec74f
update-sockjs: Update sockjs from version 0.3.4 to 1.1.1.
...
- Add browserify to npm dependencies.
- Add SockJS-client to npm dependencies.
- Add npm postinstall script to generate browser version of SockJS-client
from npm package.
- Change deprecated SockJS object property 'protocol_whitelist' to
'transports'.
- Fix settings.
2016-12-05 21:36:10 -08:00
Mikebarson
690d72d35f
mypy: Convert more zerver/lib files to typing.Text.
...
This commit touches files in zerver/lib/bugdown/ and
zerver/lib/webhooks.
2016-12-05 21:17:24 -08:00
Vamshi Balanaga
f89e732d9e
integrations: Add webhook code, API endpoint, and tests for mention.
2016-12-05 16:46:32 -08:00
sidhant bhavnani
4634c3d656
Change call signature for users_subscribed_to_stream()
...
The function users_subscribed_to_stream() now takes realm now, instead of domain.
2016-12-05 15:46:19 -08:00
bulat22101
9f68efa47b
mypy: Convert zerver/tests/ to use typing.Text.
2016-12-04 14:47:21 -08:00
Noel Tautges
07a74a8d9c
mypy: Convert zerver/views/webhooks/ to use typing.Text.
2016-12-04 11:45:46 -06:00
AZtheAsian
441743cb89
integrations: Add webhook code, API endpoint, and tests for stripe.
...
This integration still needs documentation.
2016-12-03 20:42:43 -08:00
anirudhjain75
3b891ef080
integrations: Add webhook payloads for mention.
2016-12-03 18:04:22 -08:00
Reid Barton
ecfa397567
Fix several type annotations for mypy 0.4.6 compatibility.
...
A few functions had arguments removed without having their type
annotations updated accordingly. As a result mypy version 0.4.6
thinks that the first type in the annotation is supposed to be
the type of `self`, a new mypy feature which we are not intending
to use here.
2016-12-03 13:45:52 -08:00
nikolay
abc2ff4a06
pep8: Fix many rule E128 violations.
...
[Tweaked by tabbott to adjust some approaches used in wrapping]
2016-12-03 13:33:31 -08:00
bulat22101
a6f91064a2
pep8: Fix E129 violations
2016-12-03 10:56:36 -08:00
bulat22101
adebc75740
pep8: Fix E502 violations
2016-12-03 10:56:36 -08:00
anirudhjain75
a697261e74
integrations: Add webhook payloads for papertrail.
2016-12-03 10:28:49 -08:00
Bickio
7bf3ac7e90
integrations: Add webhook payloads for Stripe.
2016-12-02 20:05:37 -08:00
Arpith Siromoney
4491ea8d6b
reactions: Add support for removing emoji reactions.
...
This commit adds support for removing reactions via DELETE requests to
the /reactions endpoint with parameters emoji_name and message_id.
The reaction is deleted from the database and a reaction event is sent
out with 'op' set to 'remove'.
Tests are added to check:
1. Removing a reaction that does not exist fails
2. When removing a reaction, the event payload and users are correct
2016-12-02 16:39:53 -08:00
Sidhant Bhavnani
8c0c12c1d9
pep8: Fix E303 violations.
2016-12-02 15:34:11 -08:00
Alex Huang
007b693cc7
pep8: Fix E131.
2016-12-01 23:16:47 -08:00
Alex Huang
c8ddea16c3
pep8: Fix E122.
2016-12-01 23:16:35 -08:00
AZtheAsian
62494eeb97
pep8: fix E201 violations
2016-12-01 23:06:02 -08:00
AZtheAsian
7e14fe65ab
pep8: fix E202 violations
2016-12-01 23:06:02 -08:00
AZtheAsian
1ba150fa85
pep8: Fix E203 violations
2016-12-01 20:37:57 -08:00
Tim Abbott
aab5ca620e
tests: Improve some close paren formatting.
2016-12-01 14:18:11 -08:00