Commit Graph

2004 Commits

Author SHA1 Message Date
Rishi Gupta
dbac262509 hotspots: Change hotspots to have a name and a description. 2017-06-13 12:59:33 -07:00
Aditya Ramesh
a77aa79da9 emails: Add html versions of emails that do not have them.
Fixes #4691.
2017-06-12 23:02:28 -07:00
Rishi Gupta
1f77a0cdee confirmation: Remove Confirmation.objects.send_confirmation.
I think it makes sense to wrest the email sending from confirmation, now
that we have a clean email-sending interface in send_email. A few other
reasons:
* send_confirmation is get_link_for_object followed by send_email, but those
  two functions have no arguments in common.
* Sending email through confirmation obfuscates the context dict, and is a
  relatively complicated piece of the codebase anyone trying to deal with
  the email system has to understand.
* The three emails previously being sent through confirmation don't have
  that much in common, other than that they happen to have a confirmation
  link in them.

The .split('/')[-1] in registration.py is a hack, but a hack used several
places in the codebase, so maybe one day get_link_for_object will also
return the confirmation_key.
2017-06-12 23:02:28 -07:00
Rishi Gupta
e30211a524 confirmation: Remove custom_body argument from send_confirmation. 2017-06-12 23:02:28 -07:00
Rishi Gupta
9a02739008 emails: Remove invitation_mit. 2017-06-12 23:02:28 -07:00
Rishi Gupta
215568aae2 actions.py: Remove transaction.atomic from do_start_email_change_process.
Don't think it's necessary?
2017-06-12 23:02:28 -07:00
vaibhav
dbc56e29a5 bots: Add simple flask server for running contrib bots. 2017-06-12 22:08:44 -07:00
Steve Howell
e3c6c22269 Optimize push_notifications.response_listener().
We were needlessly getting a UserProfile object out of cache,
when we only needed the user_id.
2017-06-10 10:43:57 -07:00
Steve Howell
549a1626d9 Optimize get_recipient_user_profiles().
For the fairly rare case that a user sends messages to themselves,
we now only call get_user_profile_by_id() once.
2017-06-10 10:43:57 -07:00
Rishi Gupta
15b967fc3e emails: Move support_email into a common context. 2017-06-10 01:25:44 -07:00
Rishi Gupta
056489c247 emails: Move verbose_support_offers into a common context.
Server settings should just be added to the context in build_email, so that
the individual email pathways (and later, the email testing framework)
doesn't have to worry about it.
2017-06-10 01:16:03 -07:00
Rishi Gupta
69e7029663 test_emails: Use zerver.lib.send_email for rendering email.
Previously the rendering code in test_emails.py did not match the rendering
code in send_email.py. This commit removes the duplication to reduce the
chance they drift in the future.

This commit also changes test_emails.html to ensure that we always display
both the HTML and text versions of an email.
2017-06-09 23:34:24 -07:00
Harshit Bansal
7be2e17827 message.py: Use dict's subscript syntax in ReactionDict.
Instead of using dict's `get()` method use the subscript syntax
so that we can assert correctly that the reaction row contains
all the fields and if not raise the `KeyError` instead of silently
returning None.
2017-06-09 16:38:58 -07:00
Cory Lynch
6653e19e3a Add URL for viewing node coverage data on dev server.
Running test-js-with-node --coverage now provides a URL
to view the output data on the web.

Fixes #5177.
2017-06-09 16:17:30 -07:00
Akhil
4986027126 org-settings: Add backend for notifications stream.
Realm.notifications_stream is not a boolean, Text or integer field, and
thus doesn't fit into the do_set_realm_property framework. Added function
to update it in actions.py. Altered the view, realm.py, to accept
stream-id. Also, notifications stream can be disabled by sending a
negative id.
2017-06-09 16:03:52 -07:00
Jack Zhang
98a785bb25 message_edit: Replace highlighting replaced text with delete / insert.
Rationale: For the more off-to-the-side edit history view, changes
are easier to digest by highlighting deleted content in red followed
immediately by added and changed content in green.

TODO: Toggle for showing the edited messages without highlighting;
deleted content would not be shown in this view.
2017-06-07 11:06:15 -07:00
Rishi Gupta
15e5814c27 emails: Prevent subject lines and plaintext emails from being HTML-escaped.
Adds a new template engine with autoescape=False, and uses the new engine to
render subject lines and plaintext emails.
2017-06-06 23:22:22 -07:00
Aditya Bansal
12c6ffa593 Migrate integrations/twitter.html to markdown. 2017-06-06 22:00:35 -07:00
Aditya Bansal
642deef72f Migrate integrations/google-calendar.html to markdown. 2017-06-06 22:00:03 -07:00
Aditya Bansal
2adfc8be4d Migrate integrations/trac.html to markdown. 2017-06-06 21:57:32 -07:00
Aditya Bansal
08c5af5e39 Migrate integrations/subversion.html to markdown. 2017-06-06 21:56:46 -07:00
Aditya Bansal
26212a55dd Migrate integrations/openshift.html to markdown. 2017-06-06 21:55:16 -07:00
Aditya Bansal
ee53f80de9 Migrate integrations/nagios.html to markdown. 2017-06-06 21:50:25 -07:00
Aditya Bansal
a712a789fc Migrate integrations/git.html to markdown. 2017-06-06 21:48:54 -07:00
Aditya Bansal
a1f24dc6a3 Migrate integrations/mercurial.html to markdown. 2017-06-06 21:48:04 -07:00
Aditya Bansal
6fec949678 Migrate integrations/jira-plugin.html to markdown. 2017-06-06 21:46:46 -07:00
Aditya Bansal
6b86de3a3c Migrate capistrano.html to markdown. 2017-06-06 21:40:28 -07:00
Abhijeet Kaur
60ff82ed7c bots: Add UI for creating different types of bot.
Add 'Type of bot' option for bots by adding dropdown option in
settings->"Your bots".  For now, this allows creating incoming webhook
bots in addition to default bots.

This will enable users to add a bot as an incoming webhook
(in addition to add full-featured bots).

With various minor tweaks and cleanups by tabbott.

Fixes #2186.
2017-06-06 21:11:22 -07:00
Tim Abbott
f7b604f9be webhooks: Fix unnecessary/buggy translation string. 2017-06-06 11:59:36 -07:00
Umair Khan
b09b60dfff Revert "test-backend: Enable test coverage in multi-process mode."
This reverts commit a22d6d2c2a.
2017-06-06 13:07:16 +05:00
Eeshan Garg
ae8eb14e5a integrations: Specify a generic URL in GithubIntegration.
We now supply a generic URL for our legacy and webhook GitHub
integrations, as opposed to a dynamically generated URLs
for all other WebhookIntegration(s). Previously, within
GithubIntegration, an invalid URL was dynamically generated
which wasn't even used. Now, we just manually supply the URL
to GithubIntegration.

Furthermore, we'll now be able to access the correct URL in
`render_markdown_path` for our macros.
2017-06-05 11:19:57 -07:00
Tim Abbott
d2079cbb2e streams: Fix leaking private streams after last user is removed.
When the last user on a private stream is removed, the stream is no
longer possible to administer, and thus should be marked as
deactivated, so that default streams entries are removed and it no
longer appears in the UI as a non-administerable broken stream.
2017-06-04 10:40:41 -07:00
Tim Abbott
d21756c396 streams: Fix default streams list not updating on deactivation.
If you deactivated a default stream, we would correctly remove it from
the list of default streams in the organization.  However, we did not
call `send_event`, so browsers would still display it as a default
stream until the next reload.

This fixes that issue by calling do_remove_default_stream instead of
doing the database query directly.
2017-06-04 10:36:18 -07:00
Aditya Bansal
b99d62d337 pep8: Add compliance with rule E261 timeout.py. 2017-06-04 15:06:29 +05:30
Tommy Ip
8d6af030c0 bugdown: Fix modal_link.
The `data-toggle` property prevented the new style of overlay modals
from launching, and regardless, isn't a future-proof options for how
this should work.
2017-06-03 18:41:19 -07:00
Tim Abbott
a0ef2babab text_fixtures: Rename migration status file to have test in name.
This is preparation for making things clear as we move towards not
always rebuilding the test database in provision.
2017-06-02 13:27:34 -07:00
Tim Abbott
6d00da2b80 test_fixtures: Remove hardcoding of check_files status dir.
This is preparatory support for using this framework in provision as
well.
2017-06-02 13:27:34 -07:00
Aditya Bansal
8680c87f56 pep8: Add compliance with rule E261 zerver/lib/push_notifications.py. 2017-05-31 17:07:15 -07:00
K.Kanakhin
2434f2d96c messages: Add support for admins deleting messages.
This makes it possible for Zulip administrators to delete messages.
This is primarily intended for use in deleting early test messages,
but it can solve other problems as well.

Later we'll want to play with the permissions model for this, but for
now, the goal is just to integrate the feature.

Note that it saves the deleted messages for some time using the same
approach as Zulip's message retention policy feature.

Fixes #135.
2017-05-29 21:59:38 -07:00
Harshit Bansal
298e23b447 realm_emoji.py: Allow an user to delete an emoji uploaded by them.
If a realm is configured to allow any user to upload an emoji,
then, an emoji author must be allowed to delete an emoji uploaded
by them.
2017-05-29 20:21:25 -07:00
Maxim Averin
a4c3f571db Switch change_tos_version to use RealmAuditLog. 2017-05-29 15:24:01 -07:00
Maxim Averin
685fb16c39 Switch change_full_name to use RealmAuditLog.
This requires adding an `acting_user` parameter to the
`do_change_bot_owner` function.
2017-05-29 15:22:08 -07:00
Tim Abbott
9d7e6b1b48 events: Fix race with realm_waiting_period_threshold changes.
The can_create_streams property changed some time ago to depend on 2
different properties of Realm, causing occasional test failures.
2017-05-28 18:21:50 -07:00
Sarah
bb329b4020 zerver/lib/events: Refactor using UserProfile prop_types and notifications
Refactor fetch_initial_state_data to use the UserProfile.property_types
and notifications dictionaries.
2017-05-26 14:55:54 -07:00
Nathan Miller
2311e169ec mypy: Various strict-optional fixes in zerver. 2017-05-26 10:10:20 -07:00
Ethan
1477a9102d mypy: Fix return annotation; json_method_not_allowed. 2017-05-25 15:41:44 -07:00
Elliott Jin
8b98b79646 bots: Generate queue events for embedded bots. 2017-05-25 15:00:51 -07:00
Christian Hudon
8ab6a23a30 Fix most strict-optional issues in export.py. 2017-05-24 18:50:59 -07:00
Christian Hudon
1761a3b1c1 mypy: strict optional fixes. 2017-05-24 18:50:59 -07:00
Eklavya Sharma
2f227a97d3 mypy: Make zerver/lib/actions.py pass --strict-optional check. 2017-05-24 18:49:54 -07:00