Commit Graph

601 Commits

Author SHA1 Message Date
Luke Faraone f20f605376 [manual] Add file upload support.
This allows users to drag and drop content onto the compose box, storing
their data in Amazon S3.

New dependencies:
 - python-boto

(imported from commit 339874e483db5c36312c9ceae56db29da6ca0d99)
2013-04-05 13:07:13 -07:00
Luke Faraone f4d00b6af9 [manual] Push new users' data to MailChimp.
This creates a new management command, subscribe_new_users, which should be
run as a daemon process. When new users are created, an event is passed to
RabbitMQ including the following data:
 * Email
 * Full name
 * IP address of the person who confirmed registration
 * Time of registration confirmation

MailChimp strongly encourages the collection of the last two to enable
responses to abuse requests, and providing more data lowers the chance that
we could get banned from their service if complaints do occur.

To use this commit, you need to install the "postmonkey" module from
PyPI.

(imported from commit 20c628c3fa8bb985aaead85a80ad3b38bf94b9dc)
2013-04-05 10:22:26 -07:00
Zev Benjamin d4acc3dd94 blueslip: Add mechanism for reporting additional information
(imported from commit 738bd3b8800e3b67497755580a2b7ccf66bb3829)
2013-04-04 17:42:09 -04:00
Leo Franchi 8fe82085c4 [schema][manual] Automatically subscribe users to default streams only after tutorial
(imported from commit 6511851c0aee2628bef597bf1310d6f96b0fd1d4)
2013-04-04 17:11:39 -04:00
Luke Faraone 86d794c3f8 Updating the pointer is logically a PUT, not a POST.
(imported from commit 191582008c15861639acd882742f22b3fd17445a)
2013-04-03 15:35:59 -07:00
Luke Faraone 50809ca219 Rename process_patch_as_post to process_as_post for generality
(imported from commit c920216176a8b6d4b0172a60b6e65df6a58fc79a)
2013-04-03 15:35:58 -07:00
Leo Franchi aef86a8d45 Use form POST data for beanstalk and add shim for incorrectly-encoded emails
(imported from commit b5debaa02a6a23c01aee1b2beb6fd83e70e50d65)
2013-04-03 10:21:06 -04:00
Zev Benjamin c8acdfb228 Make the default for API-users be apply_markdown=False
This fixes a regression that was introduced when rebasing the event
system branch.

(imported from commit da575e96ebdb4dbcca3a658a10a0f81628f9317c)
2013-04-02 17:04:26 -04:00
Keegan McAllister 5ebd281f38 Serve only the runtime part of Handlebars in prod
(imported from commit 8e55cb99deff680c832502396625b8cb1054e0cb)
2013-04-02 14:44:27 -04:00
Zev Benjamin 369d9ab9e7 Add additional URLs for get_updates activity
(imported from commit 820f0f48abbe99d0ab4a769f8c2f4cafa56dc050)
2013-04-02 14:18:33 -04:00
Zev Benjamin 649119ead5 Allow specifying multiple URLs for a given query name in ActivityTable
(imported from commit 1a3313d27168447025d0c98d72d2f6ab0c32587e)
2013-04-02 14:18:33 -04:00
Zev Benjamin 99f98f77b6 Refactor activity data-gathering a bit
(imported from commit 6d36bf19c5ba70cc4d29bf7340e4c6a7349f1083)
2013-04-02 14:18:33 -04:00
Leo Franchi a406aeadc8 Add beanstalk integration along with tests
Beanstalk integration uses webhooks that use http basic auth to authenticate
the sending user.

(imported from commit bd65f5b2d052a3c1eb04da64d055a3640a384892)
2013-04-02 13:35:42 -04:00
Tim Abbott 1cec86eb2d [manual] Remove now-unused User model.
I think all that one needs to do to deploy this commit is on developer
laptops, run `generate-fixtures --force`.

(imported from commit 34916341435fef0875b5a2c7f53c2f5606cd16cd)
2013-04-02 12:57:10 -04:00
Tim Abbott a8e89962d8 Remove remaining direct usage of the User model.
(imported from commit c494b4e32761e9ce57115da918a86a1d6a0b6971)
2013-04-02 12:07:08 -04:00
Tim Abbott 5dbe8b4c17 [manual] Authenticate using a user_profile as request.user.
When this is deployed to staging, we need to run

./manage.py logout_all_users --realm=humbughq.com

When this is deployed to prod, we need to run

./manage.py logout_all_users

(imported from commit d6c6ea4b1c347f3d9122742db23c7b67767a7349)
2013-04-02 12:07:08 -04:00
Tim Abbott 2fcbb31dcf Access the UserProfile's new is_active field rather than User's.
(imported from commit ed5bdaf3e3d6d20bfb741efdac48d30482ab9ef7)
2013-04-02 12:07:08 -04:00
Tim Abbott 1443edce00 Access the UserProfile's new email field rather than using User.
This is preparatory for stopping using the User model.

(imported from commit a1b0808c8cc2ddd19a25163f91c4f18620c9ce90)
2013-04-02 12:07:08 -04:00
Zev Benjamin 2c08fcca3a Send an event when a subscription is added or removed
We don't yet send events on property changes, though.

(imported from commit 741e6aff7c6ce8b6a1fa48e4d95317d345c6993d)
2013-04-01 13:07:48 -04:00
Zev Benjamin fe45b1c8ad Send an event when a user joins or leaves the realm
(imported from commit fcedba2d9a3e8968e93faa396113cddd5bf36a9d)
2013-04-01 13:07:48 -04:00
Tim Abbott 203e5e17ee Use prereg_user as local variable for PreregistrationUser objects.
(imported from commit 5beb09a8e589bee9e98d36059eb9e0b5ab3c4af3)
2013-03-29 16:18:38 -04:00
Tim Abbott 2223b60dc0 Switch functions like do_activate_user to accept UserProfiles.
Only a few of them took a User as an argument anyway.

This is preparatory work for merging the User and UserProfile models.

(imported from commit 65b2bd2453597531bcf135ccf24d2a4615cd0d2a)
2013-03-29 16:18:37 -04:00
Leo Franchi e546161e8d Handle web hooks from JIRA for integration support
(imported from commit d4db0b850becf42dee6f0a9df7b19c692fef41f1)
2013-03-29 16:14:39 -04:00
Jessica McKellar 07967e7257 Add the ability to narrow to starred messages with `is:starred`.
(imported from commit f1eb552ddd90a1822fa988b60dc13f88f04cfc79)
2013-03-28 16:59:59 -04:00
Zev Benjamin 00e5f904a3 Use do_events_register() in home() and pass the results to the initial page load
(imported from commit 532036c01bde1f5d49c43a96ce6aa496ca77cea9)
2013-03-28 16:57:48 -04:00
Zev Benjamin 3b5bcdf80e Move the guts of event_register_backend to actions.py so it can be called internally
(imported from commit 4747942b03406e8a92f319658fcecb9720226388)
2013-03-28 16:57:48 -04:00
Zev Benjamin 5b20dcf03c Add server-side event filtering based on type
Clients can now request to receive only certain kinds of events,
although they always receive restart events.

(imported from commit 1e72981f8fe763829ab2abde1e35f94cad5c34e4)
2013-03-28 16:57:48 -04:00
Zev Benjamin f2b1de7940 Apply events in register()
(imported from commit 4e30e52d968ceec596ecbabe71d4d9378cc8f7d9)
2013-03-28 16:57:48 -04:00
Zev Benjamin 7248659c4c Return initial data in register()
(imported from commit 5b510ef072790b9e44652542372e3fc88735c356)
2013-03-28 16:57:48 -04:00
Zev Benjamin 6cc70d94f6 Add register() call to event system
(imported from commit 0c9fbfec1866591b2169ce2da2bc2af6003f8f31)
2013-03-28 16:57:47 -04:00
Keegan McAllister 5a58fb3c29 Don't try to use source map in the test suite either
(imported from commit c8392c1572a09128d8b31500b3e94bb9e8888122)
2013-03-28 16:47:11 -04:00
Keegan McAllister 28f9d51aa5 Don't try to use source map when DEBUG
(imported from commit e07fbe0e185df06c98cc38dfb943036f256cb877)
2013-03-28 15:28:58 -04:00
Keegan McAllister 7236c63008 Automatically decode JavaScript stack traces as we send them
(imported from commit 348c464102a43a44c91c79d498cd33e6405ed670)
2013-03-28 14:56:52 -04:00
Luke Faraone 85b4ffbf2e Change matching for client strings in /activity to use __startswith.
This way we can match prefixes, like "API: Foo".

(imported from commit 2acde88e31b4f2f4a418f3930975a5f3a4e9ef2d)
2013-03-28 08:11:37 -07:00
Luke Faraone 8bb944729d Switch get_old_messages to REQ and make the function signature uniform.
Previously user_profile was a kwarg, which was inconsistent with all other
_backend functions.

(imported from commit 6b857bcb2c3c978079af2f6edd367c1804d51988)
2013-03-28 07:53:39 -07:00
Luke Faraone 5d22ee9a76 Create update_subscriptions_backend to allow mass mutation of user subs.
This includes a process_patch_as_post decorator which enables this view
to be invoked as a PATCH on an object.

Hopefully this decorator can go away once POST values are correctly parsed
in Django for PATCH verb invocations.

(imported from commit 6cf9d69cfb9dea5354ea37408566146757b5be54)
2013-03-28 07:53:39 -07:00
Luke Faraone 08e379d23f Add method for retrieving the pointer only.
(imported from commit 2324d3c6cddca73dddca8a24dfa8d61d41236a54)
2013-03-28 07:53:38 -07:00
Luke Faraone a49c37917a Implement generic rest_dispatch method for new API.
(imported from commit 912ee803db03098f195d18648ab98401915fead6)
2013-03-28 07:53:38 -07:00
Luke Faraone 0c0f99ccc6 Split off json_stream_exists to the _backend pattern, rename paramater for consistency.
(imported from commit 61378e9abe716552f69cf11fc0f1fce61de0639c)
2013-03-28 07:53:37 -07:00
Luke Faraone 60075e596f stream_exists_backend now returns a 404 if the stream is not found.
Update tests and compose.js to handle the 404.

(imported from commit d9ba4fe59c34bd14d9198e3365a845888fa04f03)
2013-03-28 07:53:37 -07:00
Luke Faraone 825f59799a Switch foo_list_subscriptions to the backend pattern.
This slightly reduces code duplication and in the future the {api,json}_ methods
will hopefully go away, leaving only the _backend methods.

(imported from commit 82a6e4a2ff2ba5d272068e9ff043ea47a1a8d278)
2013-03-28 07:53:37 -07:00
Luke Faraone 2be8f80f47 Make request._client a public member, dropping the '_'.
(imported from commit 5fc7ab57157ceb40c8bca9b0c97a47d8fac6745b)
2013-03-28 07:53:36 -07:00
Luke Faraone b6ed350c55 Remove explicit "client" parameter from send_message_backend.
Instead we now rely on the request._client value, which we were previously
passing along to s_m_b in all but one case.

For that one case, we just modify the Request object to include the value
beforehand.

(imported from commit 542f38f94bc447149cd4d2efaa5e8f48f756725b)
2013-03-28 07:53:34 -07:00
Tim Abbott 78f5c2e877 Use the update_fields option to Django ORM .save().
This can result in a significant performance benefit because we only
need to update the columns that changed..

(imported from commit 42bef1fcc58ad79bd864f89263fe82e90743ee5b)
2013-03-28 07:36:11 -04:00
Zev Benjamin 304899cd8a blueslip: Indicate whether users saw an error in the error emails
(imported from commit dd31976a3279df5ea5de2a0433387c82c8f80d41)
2013-03-27 21:53:58 -04:00
Zev Benjamin 2da4c0a4bf Remove extraneous SERVER_GENERATION definition
It looks like this was supposed to be moved in e0d9182c but was
copied, instead.

(imported from commit 094f43e9cfd4dde380a3d1ef79b1c273b54ce1a3)
2013-03-27 14:15:03 -04:00
Tim Abbott fde2243dbc [django 1.5] Update read flags handling to use new Django 1.5 syntax.
(imported from commit af1e2608b6d6d3677bf6266980d8dc77739aa4ba)
2013-03-27 08:19:26 -04:00
Keegan McAllister 7309d57067 Output page_params as a single JSON object
This is a lot cleaner, and also cuts about 50-70 ms off of page load time in
local testing (with lots of users), presumably because there's less work to be
done by the slow Django template engine.

(imported from commit 257b700238ee5d9a4ae00a53011ed5bce018124c)
2013-03-26 13:51:21 -04:00
Keegan McAllister 23b8833ec5 Handle Tornado callback notify in a more generic, less HTTP-centric way
(imported from commit 85a74d1b40461236c4c95ad688e9796ab50f0bbf)
2013-03-22 15:51:23 -04:00
Jessica McKellar 37e58b613d Truncate the tutorial stream name to fit the DB max stream name length.
(imported from commit e267656337f97d3ea14e14e957a405cf4fd2d06c)
2013-03-20 10:15:08 -04:00