Commit Graph

20983 Commits

Author SHA1 Message Date
Tim Abbott 0368b76468 static: Clean up organization of .gitignore. 2017-09-22 15:14:43 -07:00
Eeshan Garg 390a1fec92 zulip_bots: Generate static files during provisioning.
This commit implements support for copying over static files
for all bots in the zulip_bots package to
static/generated/bots/ during provisioning. This directory
isn't tracked by Git. This allows us to have access to files
stored in an arbitrary zulip_bots package directory somewhere
on the system. For now, logo.* and doc.md files are copied over.

This commit should act as a starting point for extending our
macro-based Markdown framework to our bots/API packages'
documentation and eventually rendering these static files
alongside our webhooks' documentation.
2017-09-22 15:14:42 -07:00
Tim Abbott c5cfcd7844 settings: Move the templating configuration further down.
The motivation for this is that we'll want to use the STATIC_ROOT
variable in this code in the upcoming commits.

While we're at it, we give it a proper section in the file.
2017-09-22 15:12:13 -07:00
Tim Abbott 84926ff321 slow_queries: Log slow queries even if not reported via Zulip.
This should help make these logs more useful for debugging on an
arbitary Zulip system.
2017-09-22 14:11:07 -07:00
Tim Abbott ec61a070b4 signups: Add basic logging for new signup processing. 2017-09-22 14:11:07 -07:00
Tim Abbott f78dd33037 invites: Add logging for newly sent invitation emails. 2017-09-22 14:11:07 -07:00
Vishnu Ks 61e48734a7 provision: Add moreutils in APT common dependencies.
This fixes an issue where `tools/update-locked-requirements` would fail.
2017-09-22 14:04:57 -07:00
Tim Abbott 8badd10a6c send_test_email: Remind users to restart the server after updates. 2017-09-22 13:32:22 -07:00
Tim Abbott 3708f5708a upgrade: Include zulip::static_asset_compiler by default.
Since we've found that it's fairly frequent that we want to recommend
to developers that they upgrade to a version of Zulip from Git, it
makes sense to include that by default.
2017-09-22 11:38:20 -07:00
Tim Abbott 4da9e77096 docs: Expand documentation of provisioning.
Fixes #2668.
2017-09-22 11:23:17 -07:00
Tim Abbott b1f4c7308e docs: Fix a broken link in new documentation. 2017-09-22 11:23:17 -07:00
Tim Abbott 876fd95486 docs: Document how our dependencies are managed.
Fixes #5481.
2017-09-22 11:09:58 -07:00
Juliana Bacelar 928dd06cc8 linter: Add lint rule banning 'import os.path' 2017-09-22 10:32:21 -07:00
Steve Howell f965a156a9 Revert "Get unread messages from the server in the web app."
This reverts commit c953759486.

The client side logic for dealing with server counts is actually
fine, as far as we know, but there are still some data-related
issues with cleaning up old unread counts.
2017-09-22 10:20:19 -07:00
Tim Abbott de9f00208d test_notifications: Fix unnecessary use of dirname. 2017-09-22 10:17:54 -07:00
Tim Abbott 3d63f981a1 test_notifications: Clarify code for new MissedMessages test. 2017-09-22 10:16:24 -07:00
Harshit Bansal e4c1aa37f3 notifications: Add tests for `relative_to_full_url()` function.
Fixes: #6544.
2017-09-22 10:04:33 -07:00
Harshit Bansal e453586741 notifications.py: Add regex for matching relative avatar URLs. 2017-09-22 10:04:33 -07:00
Harshit Bansal 660ad5824b notifications.py: Improve the regex for matching relative URLs.
Fixes: #6593.
2017-09-22 10:04:33 -07:00
Harshit Bansal c9878139b9 notifications.py: Extract `relative_to_full_url()` as a global function. 2017-09-22 10:04:33 -07:00
Vishnu Ks b4fedaa765 backend: Add support for multiuse user invite link. 2017-09-22 07:56:53 -07:00
Vishnu Ks 68ccfe78e6 registration: Add optional streams argument to send_registration_completion_email. 2017-09-22 07:51:58 -07:00
Vishnu Ks 3cc9feb676 models: Create MultiuseInvite model. 2017-09-22 07:51:58 -07:00
Tim Abbott b1dafe5d9d renumber-migrations: Fix last_correct_migration code. 2017-09-22 07:51:58 -07:00
Tim Abbott 1edd137263 RealmAuditLog: Pass acting_user to do_reactivate_user. 2017-09-22 07:33:02 -07:00
Tim Abbott 92b70f9895 RealmAuditLog: Fix missing mypy annotation. 2017-09-22 07:33:02 -07:00
Tim Abbott dc843efd56 RealmAuditLog: Add support for stringifying entries. 2017-09-22 07:09:37 -07:00
Tim Abbott bc69d28bf8 dev_tools: Document populate_db. 2017-09-22 06:42:25 -07:00
Rishi Gupta b6ea225187 devtools: Add documentation for zilencer management commands. 2017-09-22 06:39:58 -07:00
Rishi Gupta 0727f045f5 zilencer: Add management commands to create new dev users and realms. 2017-09-22 06:35:43 -07:00
Rishi Gupta 6ec3595b77 emails: Change enqueue_welcome_emails to take a user rather than user_id. 2017-09-22 06:20:33 -07:00
Rishi Gupta a7c8770f97 emails: Move enqueue_welcome_emails outside of signups queue.
The only thing this queue should do is sign you up for the newsletter, since
it is only populated if newsletter_data is not None.
2017-09-22 06:20:33 -07:00
Cynthia Lin 395a71a433 subs: Fix jerky stream subscriptions scrolling with up/down keys.
Fixes #4230.
2017-09-22 05:09:14 -07:00
Rishi Gupta 88bec16452 hotspots: Only narrow to PMs on first load.
After first load, the browser should set tutorial-status to started,
so this should automatically only happen once.

Fixes #6575.
2017-09-22 05:01:53 -07:00
julianasobreira df2d448f7b python: Add lint rule banning 'from os.path import'.
This enforces our use of a consistent style in how we access Python
modules; "from os.path import dirname" is a particularly popular
abbreviation inconsistent with our style, and so it deserves a lint
rule.

Commit message and error text tweaked by tabbott.

Fixes #6543.
2017-09-22 04:55:38 -07:00
Brock Whittaker e0a9310c41 subscriptions: Maintain scroll position when subscribing.
The current behavior is that when you subscribe to a new stream
the scroll position moves back up to the top because the list updates,
when in reality the user shouldn't notice this, so we record the
previous scroll position and then apply it once the DOM update is
finished before the next paint cycle.

Fixes: #6606.
2017-09-21 09:09:45 -07:00
Tim Abbott 7554958316 test_signup: Add a test for invite emails being cleared. 2017-09-21 06:15:11 -07:00
Tim Abbott f706f657c0 signup: Fix invitation emails not being cleared properly.
Previously, invitation reminder emails were only being cleared after a
successful signup if newsletter_data was available, since that was the
circumstance in which we were calling the relevant queue processor
code.  Now, we (1) clear them when a human user finishes signing up
and (2) correctly clear them using the 'address' field of
ScheduleEmail, not user_id.
2017-09-21 06:15:11 -07:00
Tim Abbott 660d8d4bc4 ScheduledJob: Add a __str__ function to make them more easily printed. 2017-09-21 06:05:18 -07:00
Brock Whittaker ae4c3873af navbar: Re-center home icon within <li> tab.
The home icon was too far to the right and did not have equal
padding within the <li> tab so this makes the padding an equal
10px on the left and right and none on the top and bottom.
2017-09-20 15:23:38 -07:00
Steve Howell 6ce68dfc3d minor: Remove obsolete lint check.
Some code that we had a lint exception for got cleaned up in a
recent commit.
2017-09-20 13:05:04 -07:00
Steve Howell 9110ff935e tests: Restore 100% coverage to views/messages.py.
A recent change moved some untested code into messages.py, which
requires 100% coverage.  Now we test bogus stream names in
exclude_muting_conditions.
2017-09-20 13:02:22 -07:00
Steve Howell 428d3027c2 Only require ids for finding DefaultStream objects.
We don't need full Realm objects to find DefaultStream
objects for a realm.  So now a few functions related to
adding/removing default streams use realm_id for lookups.

Similarly, we don't need a full Stream object to find
out if a stream exists in DefaultStream, so we do id
lookups there as well.

This sets us up to use thinner objects in callers.
2017-09-20 10:31:33 -07:00
Steve Howell fd58d472a5 Use update_fields in do_deactivate_stream.
We are generally explicit about which fields we save.
2017-09-20 10:31:33 -07:00
Steve Howell f13cb94d84 Have exclude_topic_mutes() accept a stream id.
We want to convert stream names to stream ids as close
to the "edges" of our system as possible, so we let our
caller do the work of finding the stream id for a stream
narrow.
2017-09-20 10:31:33 -07:00
Steve Howell 7b2340decd Extract stream_name_in_use().
Checking to see if a stream exists is more idiomatic
if we just use exists() from Django.  We encapsulate it
for case insensitivity purposes.
2017-09-20 10:31:33 -07:00
Steve Howell 9046efb71a Use `prereg.users.set()` in do_invite_users.
This is a bit more idiomatic for many-to-many relationships.
2017-09-20 10:31:33 -07:00
Steve Howell 8ad7133351 Cache active_user_ids() more directly.
We now have a dedicated cache for active_user_ids() that only
stores a list of user_ids.

Before this commit, active_user_ids() used a cache of UserProfile
dictionaries, so it incurred unnecessary deserialization costs for
all the user fields that it sliced away in a list comprehension.

Because the cache is skinnier here, we also need to invalidate it
less frequently.  Basically, all we care about is new users, realm
deactivations, and user deactivations.

It's hard to measure how much this will improve performance, because
the speedup for any operation here is pretty minor, but we use this
function a lot, so hopefully it will make the overall system more
healthy.
2017-09-20 10:31:33 -07:00
Steve Howell cad3a35b6a Only require realm_id for active_user_ids().
This is mostly a preparatory commit for an upcoming optimization
related to stream data, but it probably does save us an
occasional DB hop to the realm table.
2017-09-20 10:31:33 -07:00
Steve Howell 26735eeeac Only require realm_id for get_active_user_dicts_in_realm().
This is a preparatory commit that will eventually allow us
to avoid fetching realm info that we don't need, in other
parts of the codebase.
2017-09-20 10:31:33 -07:00