Commit Graph

20359 Commits

Author SHA1 Message Date
Harshit Bansal 6936bb1ba0 zulip_tools.py: Add `get_caches_to_be_purged()` function.
Given the path of directory containing all the caches, a list of
caches in use and threshold days, this function returns a list
of caches which can be removed safely.
2017-08-22 23:59:45 -07:00
Harshit Bansal e71f92b09e zulip_tools.py: Add `get_threshold_timestamp()` function.
Given `threshold_days` this function returns a timestamp corresponding
to the time before threshold number of days.
2017-08-22 23:57:20 -07:00
Harshit Bansal 8954605726 zulip_tools.py: Add `get_recent_deployments()` function.
This function returns a list of all the deployments directories
which are newer than some threshold number of days including the
`/root/zulip` directory if it exists.
2017-08-22 23:57:20 -07:00
Harshit Bansal 931e4752aa zulip_tools.py: Add `get_environment()` function.
This function can be used to determine the environment in which a
script is being executed.
2017-08-22 23:57:20 -07:00
Max Schaefer 4825b6e5ad topic_list: Remove a spurious assignment and simplify a conditional.
Variable `show_topic` was assigned in both branches of the
conditional, but the assignment in the "then" branch was useless,
since the variable wasn't subsequently read. Hence the assignment can
be dropped, leaving the "then" branch empty. The "if" statement can
then be simplified by removing the "then" branch entirely and flipping
the condition. Since `show_topic` is now only used inside the "if", it
is slightly tidier (though semantically equivalent) to move its
declaration inside.
2017-08-22 23:49:47 -07:00
Max Schaefer 34f97cfb9a tab_bar: Remove a spurious assignment.
Variable `stream` is a local variable (declared on [line
51](85c3f59292/static/js/tab_bar.js (L51))). It
is not read after this assignment, which hence becomes useless.
2017-08-22 23:49:33 -07:00
Max Schaefer 1b445a75ad filter: Remove a spurious assignment.
Variable `predicate` is reassigned right on the next line, so this
assignment has no effect.
2017-08-22 23:49:18 -07:00
Max Schaefer 90510418a8 node_tests: Remove spurious assignments to `args`.
In both cases, `args` is a local variable that goes out of scope
immediately after the assignment. Since the variable isn't captured by
a closure either, the assignment has no effect.
2017-08-22 23:49:05 -07:00
Max Schaefer bbe87231cd upload_widget: Remove a spurious argument.
This call refers to the `accept` function on [line
118](85c3f59292/static/js/upload_widget.js (L118)),
which takes no arguments (unlike the `accept` function on [line
33](85c3f59292/static/js/upload_widget.js (L33)),
which takes one argument, but isn't in scope here).
2017-08-22 23:48:55 -07:00
Robert Hönig 1e4283aabf docs: Update bots-guide.md to reflect current APIs.
Tweaked by tabbott to do some line-wrapping and small edits.
2017-08-22 23:46:20 -07:00
Umair Khan d59e381131 casper: Make sure account-settings-status is invisible. 2017-08-22 23:37:20 -07:00
Tim Abbott 2686dcc5fb about: Add some extra detail to the history description. 2017-08-22 23:34:44 -07:00
Brock Whittaker b4d0d09cc2 about: Add a banner to /about/ with a picture from PyCon.
This adds a PyCon banner photo of people working on sprints to the
top of the /about/ page.
2017-08-22 23:34:34 -07:00
Tim Abbott 06f8fd529d realm: Add clear error message for too-long realm name.
This fixes an exception we saw in production, as well as fixing the
form to not offer ultra-long names that we don't allow.
2017-08-22 22:04:52 -07:00
franziskagoltz 61fbf1a7e3 editing: Hide topic-edit-pencil if message editing is disabled.
This fixes a confusing bug where administrators would be offered the
convenient topic-edit pencil even if message editing was actually
disabled.

This doesn't yet fix the real-time sync issues of changing the setting
without reloading.

Fixes #5946.
2017-08-22 19:43:56 -07:00
Tim Abbott 669b1b8adb mypy: Fix an annotation. 2017-08-22 17:39:24 -07:00
Brock Whittaker d07281fa66 rename: Change list_rendering.js => list_render.js.
The method itself is called `list_render`, so the file should
reflect that name.
2017-08-22 17:37:36 -07:00
Steve Howell 110cfcb640 Support --all options in fix_unreads.
(We also changed the email metavar to accept multiple emails.)
2017-08-22 20:06:30 -04:00
Steve Howell 752bf14443 fix_unreads: Improve cursor handling.
Before adding the context manager, we were leaking cursors, which
was a non-issue for updating individual users, but it's easy to
fix.
2017-08-22 20:06:26 -04:00
Steve Howell c5e083857b fix_unreads: Mark pre-pointer messages as unread (unless muted). 2017-08-22 20:03:18 -04:00
Steve Howell 8b16c6060c Split out fix_unreads management command.
Most of the code in show_unreads is for diagnosising unread
counts issues, and we may not use that often.

We're creating a dedicated fix_unreads management command with
less clutter.
2017-08-22 19:38:44 -04:00
Brock Whittaker 25e5a10a5b unicode: Replace "×" with HTML and HEX entities.
This refactors and fixes unicode issues where entities don't display
properly due to being a special character that seems to be rendered
incorrectly in a non-deterministic way every time.
2017-08-22 16:31:53 -07:00
Tim Abbott 7c37fc8909 auth: Improve robustness of not sending duplicate login emails.
Previously, we had a very not-robust check on the URL, which might
have caused cases like Google auth registration to not do the right
thing.
2017-08-22 16:26:30 -07:00
Tim Abbott 50ad679342 test-backend: Recommend snakeviz over runsnake.
It has support for Python 3.
2017-08-22 15:44:30 -07:00
Preston Hansen c31ef34491 enqueue_digest_emails: Only send digest emails weekly, on Tuesday.
Fixes: #6114.
2017-08-22 15:07:53 -07:00
Tim Abbott 8dff14430e tools: Remove old python 3 compatibility checker.
Now that we've migrated over to Python 3, this tool is no longer required.

Fixes #6217.
2017-08-22 14:58:59 -07:00
Tim Abbott ff346f93b5 requirements: Add missing typing dependency. 2017-08-22 14:58:54 -07:00
Harshit Bansal 1a43728b1e emoji_picker: Fix tracebacks in navigation if search results are empty.
This fixes 2 bugs:

* If you perform a search and search results are empty then if you try
  to navigate using arrow keys, page-down/page-up etc. it will give a
  traceback.
* Search for example 'a' and then navigate to the last of the search
  results using arrow keys. Now press 'tab' to go back the search box
  and restrict the search to for e.g. 'ab' and now try to navigate
  using arrow keys, page-up/page-down etc you will get a traceback.
2017-08-22 14:48:02 -07:00
Cynthia Lin ae169e7e86 README.md: Update mypy badge with link to mypy Zulip blog article. 2017-08-22 14:30:55 -07:00
Rishi Gupta 4e7d87b676 onboarding.py: Add link to getting-your-organization-started-with-zulip.
Also has a few minor updates to the rest of the text.
2017-08-22 14:26:17 -07:00
Rishi Gupta d296f29fa7 emails: Link to organization getting started guide in followup_day1. 2017-08-22 14:26:17 -07:00
Rishi Gupta 7c3f20d2ba registration: Set is_realm_admin on user creation.
This makes it easier for later parts of the user creation/onboarding process
to condition on whether the user is a realm admin.

No change in behavior.
2017-08-22 14:26:17 -07:00
Rishi Gupta d28337869e help: Fix links to integrations in organization getting started guide. 2017-08-22 14:26:17 -07:00
Rishi Gupta 4a74399514 emails: Update followup_day2 with better topic advice.
These topics also better match the new followup_day2 email illustrations.
2017-08-22 14:26:17 -07:00
Rishi Gupta 4fc263d947 help: Update streams advice in getting-your-organization-started-with-zulip. 2017-08-22 14:26:17 -07:00
Tim Abbott bcf34fea33 requirements: Downgrade sphinx.
The latest version seems to not work for us on ReadTheDocs.
2017-08-22 13:21:15 -07:00
Brock Whittaker 52588cb2b6 Upgrade jQuery to v3.2.1. 2017-08-22 12:54:26 -07:00
Brock Whittaker 09be694ea3 Rewrite scrollbar width check to not use jQuery.
This check was going to do the wrong thing when we upgraded to jQuery 3.
2017-08-22 12:50:54 -07:00
Rishi Gupta b32fe9f2a0 features: Update screenshot and add tool to generate.
This adds a new management command that should make generating or
updating screenshots a bit easier in the future.
2017-08-22 11:32:22 -07:00
Umair Khan a5c05f9812 push_notification: Retry event in case of error.
Fixes #5301
2017-08-22 11:16:48 -07:00
Umair Khan 62cae23601 queue: Extract event retry into retry_event().
This commit takes the code from zerver.lib.outgoing_webhook.request_retry
and creates a new generic function called retry_event.
2017-08-22 11:16:48 -07:00
Brock Whittaker 1a9c1241af Disable ability to highlight message reactions.
This adds the `user-select: none` property to `.message_reactions`
to disable accidental highlighting or selecting of the text.
2017-08-22 11:11:40 -07:00
Robert Hönig c98ed31e80 testing: Remove obsolete coveralls conf file.
Instead of coveralls, we now use codecov.
2017-08-22 11:10:55 -07:00
Steve Howell 81e3f489f2 Use sender realm in user_profiles_from_unvalidated_emails.
This change is mostly based on a similar commit from hackerkid
in a feature branch.  It borrows both code and ideas.  Some of
it's my own stuff, as I was working on a newer branch.

We now call get_user_including_cross_realm_email() inside of
user_profiles_from_unvalidated_emails(), instead of using
get_user_profile_by_email.

This requires a few of our callers to pass down sender into us.

One consequence of this change is that we change the symptoms
for trying to send to emails outside of your realm.  In some
cases, we simply raise an error that an email is invalid to us
instead of getting into the deeper validate_recipient_user_profiles
check.
2017-08-22 10:42:15 -07:00
Steve Howell 54edecd510 Replace adddressee.for_email() with for_user_profile().
This requires us to change not just the immediate caller, but
also some of their callers, to pass user_profile objects around
instead of emails.
2017-08-22 10:42:15 -07:00
Steve Howell c61c0f3edc Use user_profile, not email, in check_message().
We are trying to convert emails to user_profiles earlier in
the codepath.  This may cause subtle changes in which errors
appear, but it's probably generally good to report on bad
addressees sooner than later.
2017-08-22 10:42:15 -07:00
Steve Howell c56a631b65 Move user_profiles_from_unvalidated_emails -> addressee.py.
This will avoid circular dependencies.
2017-08-22 10:42:15 -07:00
Steve Howell 32f18f77d4 Extract two methods from recipient_for_emails.
We now have these methods:
    user_profiles_from_unvalidated_emails
    recipient_for_user_profiles
2017-08-22 10:42:15 -07:00
Steve Howell 30d37d1270 Add Addressee class.
This class simplifies the calling sequence to methods like
check_message and _internal_prep_message, and it's also more
type safe.

Checking for message types is encapsulated with calls to is_stream()
and is_private().  There are also shortcut constructors when you
know that the type of the address (stream vs. private), which is often.
2017-08-22 10:42:15 -07:00
Tim Abbott 0d390edeeb version: Bump PROVISION_VERSION for latest changes. 2017-08-22 10:42:01 -07:00