Commit Graph

20244 Commits

Author SHA1 Message Date
Greg Price f73e898874 manage.py: Save an extra Django startup by converting one script to a library.
This saves us from spending 200-250ms of CPU time importing Django
again just to log that we're running a management command.  On
`scripts/restart-server`, this saves us from one thundering herd of
Django startups when all the queue workers are restarted; but there's
still the Django startup for the `manage.py` process itself for each
worker, so on a machine with e.g. 2 (virtual) cores the restart is
still painful.
2017-08-20 22:37:38 -07:00
Vishnu Ks 517d9b7594 /apps/: Detect the user OS and show the appropriate app by default. 2017-08-20 22:11:56 -07:00
Aditya Bansal e1cc0455ee emoji_picker: Fix issue with emoji tab shifting.
In this commit we basically do these things:
* Clear up section_head_offsets before pushing stuff in it so that
its size doesn't keep on growing indefinitely with time and users
opening emoji picker.
* Make use of popover element to find the correct element in DOM
to scan for section elements. This prevents us from filling stuff
twice into section_head_offsets because of presence of two
elements for '.emoji-popover-subheading' in DOM since popover
destroy is an async call.
* Using this popover element also helps in avoiding manuplation
of the DOM elements of the popover that was destroyed (Because
popover destroy is async it still maybe around). One instance of
this is associating scroll event with the right instance of
'.emoji-popover-emoji-map'.
2017-08-18 12:18:39 -04:00
Aditya Bansal 7a2667ce53 soft_deactivation: Fix flaky tests by seeding message for users.
In this we basically seed a single message for the user which will
be soft deactivated by sending a stream message / group PM to
ensure that is has at least one UserMessage row, since in real
world every human user will always have at least one User Message
row.
2017-08-18 07:02:11 -04:00
Steve Howell eeb164dfc5 bug: Show the count in the bankruptcy modal.
(This was a recent regression.)
2017-08-17 23:30:41 -04:00
Steve Howell c26e000d4e Fix tools/review for python3. 2017-08-17 17:40:24 -04:00
Vaida Plankyte 919ca3431f config_error.html: Use render_markdown_path for error content. 2017-08-17 16:09:26 -04:00
Vaida Plankyte 8a29f1dcf2 config_error.html: Increase container width. 2017-08-17 11:27:36 -07:00
Tim Abbott ef722c5688 tests: Remove unused ujson imports. 2017-08-17 09:05:52 -07:00
Umair Khan 6e87108d46 result.json: Upgrade test_users. 2017-08-17 09:03:35 -07:00
Umair Khan 212571ab86 result.json: Upgrade test_subs. 2017-08-17 09:03:35 -07:00
Umair Khan eb04fc006e result.json: Upgrade test_settings. 2017-08-17 09:03:35 -07:00
Umair Khan d44c1e7070 result.json: Upgrade test_realm_emoji. 2017-08-17 09:03:35 -07:00
Umair Khan 7b85e40ef5 result.json: Upgrade test_realm_domains. 2017-08-17 09:03:35 -07:00
Umair Khan 90099ffeb2 result.json: Upgrade test_reactions. 2017-08-17 09:03:35 -07:00
Umair Khan 351426df8b result.json: Upgrade test_presence. 2017-08-17 09:03:35 -07:00
Umair Khan 4c8933b844 result.json: Upgrade test_narrow. 2017-08-17 09:03:35 -07:00
Umair Khan 7bb9ac0014 result.json: Upgrade test_messages. 2017-08-17 09:03:35 -07:00
Umair Khan 025f7247cf result.json: Upgrade test_external. 2017-08-17 09:03:35 -07:00
Umair Khan 2b7bb6e965 result.json: Upgrade test_events. 2017-08-17 09:03:35 -07:00
Umair Khan de5f43ea47 result.json: Upgrade test_bots. 2017-08-17 09:03:35 -07:00
Umair Khan 1c09f95e0e result.json: Upgrade test_auth_backends. 2017-08-17 09:03:35 -07:00
Umair Khan 6d4ba50ceb result.json: Upgrade test_views. 2017-08-17 09:03:35 -07:00
Umair Khan abed403a81 result.json: Upgrade test_classes. 2017-08-17 09:03:35 -07:00
Umair Khan cec45b0ae5 tools: Add inline string replacer for files. 2017-08-17 09:03:35 -07:00
Steve Howell 770ec92891 hotkeys: Fix "n" key to work inside a muted stream.
Normally the "n" key skips over muted streams, but if we
are currently narrowed inside a muted stream, it will now
go to the next topics within that stream.

For me the use case was that I have a stream I check up on
about once a day, and "n" would be super useful for me to
clear out unread counts while still skimming some content,
and without having to temporarily unmute the stream.
2017-08-17 09:01:49 -07:00
Tim Abbott f8b1916781 stream_sidebar_row: Rename data-name to data-stream-name.
This is for greater consistency with the rest of the codebase.
2017-08-16 18:03:44 -07:00
Tim Abbott 9271346753 stream_sidebar_row: Remove duplicate data-name attribute. 2017-08-16 18:03:44 -07:00
Tim Abbott 5e968ce30d stream_list: Use data-topic-name for topic names.
The name data-name was ambigious.
2017-08-16 18:03:44 -07:00
Tim Abbott d9dcdbbbe9 stream_popover: Use data-stream-id when building topic popovers. 2017-08-16 18:03:29 -07:00
Tim Abbott dbae28683c stream_popover: Use data-stream-id when building popover. 2017-08-16 18:03:29 -07:00
Tim Abbott c6d7cfb60b stream_popover: Fetch the current stream by data-stream-id. 2017-08-16 18:03:29 -07:00
Tim Abbott 7d9303cfe8 topic_list: Stop accessing legacy data-stream name field.
We should be using data-stream-id everywhere.
2017-08-16 18:03:28 -07:00
Tim Abbott 88e3ba9576 stream_list: Fix enter key to use data-stream-id. 2017-08-16 18:02:57 -07:00
Tim Abbott 047237e45b stream_list: Remove a reference to data-name in sidebar. 2017-08-16 18:02:56 -07:00
Tim Abbott 4acd7595cd stream_sidebar: Clean up use of ambiguously named data-id.
We prefer to specify the type of data objects wherever possible.
2017-08-16 18:02:29 -07:00
Tim Abbott 78d9fcd23a streams: Remove a reference to data-stream-name. 2017-08-16 18:02:29 -07:00
Greg Price 1dc26ba250 Bump psycopg2 dependency to 2.7.3 to get a bugfix.
This should fix #6153.
2017-08-16 17:58:13 -07:00
Greg Price b8dcac1b42 run-mypy: Stop running `mypy --py2`.
Also unconditionally use the `mypy` from our virtualenv --
that's how we ensure we use a common version across different
Zulip developers and in CI.

And as a side effect of cutting some Python 2 vs. Python 3 logic,
fix a bug where `--all` was having no effect.
2017-08-16 17:54:43 -07:00
Greg Price 6346861ccd py3: Cut out the `build-release-tarball --py3` flag.
This is now redundant, as we've applied this transformation to the
source tree itself.
2017-08-16 17:54:43 -07:00
Greg Price 78b41f375d py3: Revise and update shebang discussion in docs/shell-tips.
This keeps the examples in line with our actual codebase.

Also while I'm here revise it to explain the actual motivation for our
use of `env`, and to correct some subtle details -- it's actually the
kernel that interprets the shebang (as visible in e.g. a `strace` log),
not the shell, and when the program is executed as `./my_program.py`
the exact name including `./` is passed to the interpreter.
2017-08-16 17:54:43 -07:00
Greg Price 33430f83eb py3: Rely on the shebang to invoke provision too.
We had been forcing provision to Python 3 in dev.  Now that everything
is Python 3 and the `tools/lib/provision.py` shebang reflects that, we
can just invoke the script directly like everything else.
2017-08-16 17:54:43 -07:00
Greg Price a099e698e2 py3: Switch almost all shebang lines to use `python3`.
This causes `upgrade-zulip-from-git`, as well as a no-option run of
`tools/build-release-tarball`, to produce a Zulip install running
Python 3, rather than Python 2.  In particular this means that the
virtualenv we create, in which all application code runs, is Python 3.

One shebang line, on `zulip-ec2-configure-interfaces`, explicitly
keeps Python 2, and at least one external ops script, `wal-e`, also
still runs on Python 2.  See discussion on the respective previous
commits that made those explicit.  There may also be some other
third-party scripts we use, outside of this source tree and running
outside our virtualenv, that still run on Python 2.
2017-08-16 17:54:43 -07:00
Greg Price b7ec1b55dd py3: Cut Python 2 codepaths from provision. 2017-08-16 17:54:43 -07:00
Greg Price d968179e54 py3: Stop running on Python 2 in Travis.
This clears the way to dropping logic in lots of places
for supporting Python 2.
2017-08-16 17:54:43 -07:00
Greg Price aa0ecd79d6 zephyr: Fix bogus uses of `force_bytes` that break on Python 3.
An expression like `force_bytes(chr(...))`, on Python 3 where the
`force_bytes` finds itself with something to do because `chr` returns
a text string, gives the UTF-8 encoding of the given value as a
Unicode codepoint.

Here, we don't want that -- rather we want the given value as a
single byte.  We can do that with `struct.pack`.

This fixes an issue where the "Link with Webathena" flow was producing
invalid credential caches when run on Python 3, breaking the Zephyr
mirror for any user who went through it anew.
2017-08-16 17:23:57 -07:00
Tim Abbott 30181dcc08 node: Fix node test for user_events. 2017-08-16 16:46:41 -07:00
Tim Abbott 7cfb4e195f do_deactivate_user: Add acting user to RealmAuditLog. 2017-08-16 16:23:41 -07:00
Tim Abbott 98aae162dc do_change_full_name: Include original name in RealmAuditLog. 2017-08-16 16:23:41 -07:00
Tim Abbott 4b72b461e5 user_events: Fix buggy-looking logging code.
The previous logging exception looked like it sorta left off.
2017-08-16 16:23:41 -07:00