Commit Graph

3618 Commits

Author SHA1 Message Date
Vishnu Ks
068912ca7d tests: Add test for default stream group signup flow. 2017-11-16 21:17:31 -08:00
Vishnu Ks
cc553125a1 tests: Move check_user_subscribed_only_to_streams to test_classes ZulipTestCase. 2017-11-16 21:17:31 -08:00
Harshit Bansal
d9c2f613e3 api: Add new endpoint for reactions.
This endpoint will allow us to add/delete emoji reactions whose emoji
got renamed during various emoji infra changes. This was also a
required change for realm emoji migration.

This commit was tweaked significantly by tabbott for greater clarity
(with no changes to the actual logic).
2017-11-16 20:52:15 -08:00
Greg Price
3828305305 error_notify: Try git describe too.
Tested for graceful degradation both with `git` not existing and the
`.git` directory not existing.
2017-11-16 19:15:12 -08:00
Greg Price
41ecdd8d83 error_notify: Add some idea of the deployed code version.
Tested in dev with the help of our handy /emails/ display.
2017-11-16 19:15:12 -08:00
Greg Price
4b5c52fc99 queue: Prevent an AttributeError rather than swallowing it.
When the RabbitMQ server disappears, we log errors like these:

```
Traceback (most recent call last):
  File "./zerver/lib/queue.py", line 114, in json_publish
    self.publish(queue_name, ujson.dumps(body))
  File "./zerver/lib/queue.py", line 108, in publish
    self.ensure_queue(queue_name, do_publish)
  File "./zerver/lib/queue.py", line 88, in ensure_queue
    if not self.connection.is_open:
AttributeError: 'NoneType' object has no attribute 'is_open'

During handling of the above exception, another exception occurred:
[... traceback of connection failure inside the retried self.publish()]
```

That's a type error -- a programming error, not an exceptional
condition from outside the program.  Fix the programming error.

Also move the retry out of the `except:` block, so that if it also
fails we don't get the exceptions stacked on each other.  This is a
new feature of Python 3 which is sometimes indispensable for
debugging, and which surfaced this nit in the logs (on Python 2 we'd
never see the AttributeError part), but in some cases it can cause a
lot of spew if care isn't taken.
2017-11-16 18:33:14 -08:00
Rhea Parekh
8c4651d716 zerver/lib/actions.py: Fix translation bugs.
Fixes #7396.
2017-11-16 11:05:49 -08:00
Tim Abbott
054952a44a docs: Update links from codebase to point to ReadTheDocs. 2017-11-16 10:53:49 -08:00
David Rosa Tamsen
7072fa5b37 docs: Reorganize developer docs to improve navigation.
This commit helps reduce clutter on the navigation sidebar.
Creates new directories and moves relevant files into them.
Modifies index.rst, symlinks, and image paths accordingly.

This commit also enables expandable/collapsible navigation items,
renames files in docs/development and docs/production,
modifies /tools/test-documentation so that it overrides a theme setting,
Also updates links to other docs, file paths in the codebase that point
to developer documents, and files that should be excluded from lint tests.

Note that this commit does not update direct links to
zulip.readthedocs.io in the codebase; those will be resolved in an
upcoming follow-up commit (it'll be easier to verify all the links
once this is merged and ReadTheDocs is updated).

Fixes #5265.
2017-11-16 09:45:08 -08:00
Harshit Bansal
3b95a6d2d9 bugdown: Fix a bug in the updation logic of markdown engines.
While fixing an issue related to email gateway messages not getting
rendered properly, I unknowingly introduced a bug in the markdown
engine updation code. This commit fixes it. The issue was that for
a realm having email gateway setup, updation of realm filters would
lead to the updation of only one of the markdown engines not both.
2017-11-15 22:47:11 -08:00
Harshit Bansal
b849c5e551 bugdown: Remove an unnecessary check in do_convert(). 2017-11-15 22:47:11 -08:00
Harshit Bansal
5e5bb02e39 bugdown: Remove make_realm_filters().
This commit removes `make_realm_filters()` and merges its functionality
in `make_md_engine()` and `maybe_update_markdown_engines()`.
2017-11-15 22:47:11 -08:00
Harshit Bansal
f9f9e92443 bugdown: Correct the descriptions of Bugdown config. 2017-11-15 22:47:11 -08:00
Harshit Bansal
e615a2ab4f bugdown: Simplify the "opts" parameter of make_md_engine(). 2017-11-15 22:47:11 -08:00
Harshit Bansal
e3f2f67d0e bugdown: Rename maybe_update_realm_filters().
This commit renames `maybe_update_realm_filters()` to
`maybe_update_markdown_engines()` which sounds closer
to the semantics.
2017-11-15 22:47:11 -08:00
Umair Khan
98be0cc502 user-groups: Send delete user group event.
Fixes #7380
2017-11-15 22:35:43 -08:00
Umair Khan
cc76f7deac user-groups: Create check_delete_user_group. 2017-11-15 22:35:43 -08:00
Umair Khan
79f4a7627f user-groups: Send remove members event. 2017-11-15 22:35:23 -08:00
Umair Khan
cec3f19366 user-groups: Send add members event. 2017-11-15 22:35:23 -08:00
Umair Khan
eb48fab495 user-groups: Send description update event. 2017-11-15 22:35:23 -08:00
Umair Khan
5571122120 user-groups: Send name update event. 2017-11-15 22:35:23 -08:00
Umair Khan
912505317a user-groups: Send create group event. 2017-11-15 22:35:23 -08:00
Umair Khan
31efe951b7 user-groups: Fix function argument bug; pass group.
In remove_members_from_group_backend, we are passing user group to
remove_members_from_user_group. In remove_members_from_user_group,
expect user_group_id.
2017-11-15 22:35:23 -08:00
Umair Khan
66179ea295 bulk_add_members_to_user_group: Pass user group.
Previously we passed user group id. If we pass user group, send event is
easier.
2017-11-15 22:35:23 -08:00
Umair Khan
5ef3974e80 user_groups_in_realm_serialized: Sort groups. 2017-11-15 22:35:23 -08:00
Tim Abbott
f02e5b90f6 cross_realm: Use bulk_get_users to fix handling of missing users.
This fixes a regression in ae5ba7f4fd,
where Zulip would 500 if the newly added system bots didn't exist on
the server.

This also fixes a moderate size performance problem where we'd fetch 5
users from memcached or the database in a loop.
2017-11-15 21:24:51 -08:00
Tim Abbott
c7a975e4df users: Move check_change_full_name to actions.py.
This avoids an import loop in the next commit, and better matches our
usual code structure.
2017-11-15 17:39:09 -08:00
Vishnu Ks
6f955fbf34 actions: Replace stream.add with stream.append in process_new_human_user.
stream is a list not a set. It used to be set
and was changed to stream before getting merged.
2017-11-15 17:06:43 -08:00
Tim Abbott
6a5b965a90 integrations: Rename HUBOT_LOZENGES to HUBOT_INTEGRATIONS. 2017-11-15 14:04:19 -08:00
Aastha Gupta
3b53c692a4 integrations: Add integrations/doc/assembla.
Significantly modified by tabbott and rishig to be more maintainable.

Fixes #4542.
2017-11-15 14:04:19 -08:00
Tim Abbott
85844107fd integrations: Remove code for legacy Hubot lozenges.
We no longer display the only model anyway.
2017-11-15 14:04:19 -08:00
rht
09af29b051 zerver/lib: Text-wrap long lines exceeding 110. 2017-11-15 10:58:03 -08:00
Tim Abbott
5aa6751e7a lint: Fix long lines in newly added features. 2017-11-15 10:58:03 -08:00
Vishnu Ks
d2555e8769 api: Add support to change name of default stream groups. 2017-11-14 14:41:42 -08:00
Vishnu Ks
2af249dd5d api: Add description attribute to default stream group. 2017-11-14 14:41:42 -08:00
Vishnu Ks
f45ba7de93 api: Pass group id instead of name to default stream group api. 2017-11-14 14:41:42 -08:00
rht
cceba2023c Use makedirs directly instead of wrapping it in mkdirs. 2017-11-14 09:47:09 -08:00
rht
72ce1c6501 Use a more concise mkdir -p when the situation permits. 2017-11-14 09:47:09 -08:00
derAnfaenger
25bf15a3c9 bots: Use non-generic exception for state key removal. 2017-11-10 18:56:26 -08:00
derAnfaenger
8fccf36246 bots: Wrap StateError exceptions around BotUserData exceptions. 2017-11-10 18:56:26 -08:00
derAnfaenger
d707e3bc1d bots: Add USER_STATE_SIZE_LIMIT setting. 2017-11-10 18:56:26 -08:00
derAnfaenger
545c73c79e bots: Rename StateHandlerError to StateError. 2017-11-10 18:54:54 -08:00
derAnfaenger
71372610e3 bots: Validate state size limit directly in set_bot_state(). 2017-11-10 18:54:39 -08:00
Andy Perez
4d51a6cfac bugdown: Fix $$ whitespace handling.
The intended use of $$ is for inline expressions, not for multiline
ones; ```math is an acceptable alternative for the latter.  Hence,
the $$-syntax for inline TeX no longer permits newlines within it.

This was also necessary for the next change to be sensible; namely
allowing for spaces around both $$ when crafting inline TeX instead of
forcing everything to be crammed together, e.g. $$x=7$$.  In order to
avoid uninentionally creating inline expressions, the opening and
closing $$'s of an inline expression must now both exactly consist of
two dollar signs, no more and no less.

Fixes: #6488.
2017-11-10 16:54:27 -08:00
Tim Abbott
a23378a304 check_short_string: Verify string before checking length.
While the previous implementation was correct, this should give better
error messages.
2017-11-10 16:37:43 -08:00
neiljp (Neil Pilgrim)
72eba6a0ce mypy: Adjust validator.py to use object rather than Any. 2017-11-10 16:37:29 -08:00
neiljp (Neil Pilgrim)
331a3c3447 mypy: Migrate validator.py typing to python3 syntax. 2017-11-10 16:32:25 -08:00
rht
8e87eb4084 zerver/lib/bugdown: Text-wrap long lines exceeding 110. 2017-11-10 16:29:32 -08:00
rht
23a481c5d2 zerver/lib/actions.py: Text-wrap long lines exceeding 110. 2017-11-10 16:27:22 -08:00
Vishnu Ks
f44b60a150 Implement API for default stream groups. 2017-11-10 16:05:36 -08:00