mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	Remove obsolete /api/v1/subscriptions/add endpoint.
(imported from commit 838e3a29219acf157f16258a46b0719d97ae46de)
This commit is contained in:
		@@ -326,15 +326,10 @@ class AuthedTestCase(TestCase):
 | 
			
		||||
 | 
			
		||||
    # Subscribe to a stream by making an API request
 | 
			
		||||
    def common_subscribe_to_streams(self, email, streams, extra_post_data = {}, invite_only=False):
 | 
			
		||||
        api_key = self.get_api_key(email)
 | 
			
		||||
 | 
			
		||||
        post_data = {'email': email,
 | 
			
		||||
                     'api-key': api_key,
 | 
			
		||||
                     'subscriptions': ujson.dumps([{"name": stream} for stream in streams]),
 | 
			
		||||
        post_data = {'subscriptions': ujson.dumps([{"name": stream} for stream in streams]),
 | 
			
		||||
                     'invite_only': ujson.dumps(invite_only)}
 | 
			
		||||
        post_data.update(extra_post_data)
 | 
			
		||||
 | 
			
		||||
        result = self.client.post("/api/v1/subscriptions/add", post_data)
 | 
			
		||||
        result = self.client.post("/api/v1/users/me/subscriptions", post_data, **self.api_auth(email))
 | 
			
		||||
        return result
 | 
			
		||||
 | 
			
		||||
    def send_json_payload(self, email, url, payload, stream_name=None, **post_params):
 | 
			
		||||
@@ -512,7 +507,6 @@ class PublicURLTest(TestCase):
 | 
			
		||||
                     400: ["/api/v1/get_profile",
 | 
			
		||||
                           "/api/v1/get_old_messages",
 | 
			
		||||
                           "/api/v1/get_public_streams",
 | 
			
		||||
                           "/api/v1/subscriptions/add",
 | 
			
		||||
                           "/api/v1/send_message",
 | 
			
		||||
                           "/api/v1/update_pointer",
 | 
			
		||||
                           "/api/v1/external/github",
 | 
			
		||||
 
 | 
			
		||||
@@ -1604,10 +1604,6 @@ def remove_subscriptions_backend(request, user_profile,
 | 
			
		||||
 | 
			
		||||
    return json_success(result)
 | 
			
		||||
 | 
			
		||||
@authenticated_api_view
 | 
			
		||||
def api_add_subscriptions(request, user_profile):
 | 
			
		||||
    return add_subscriptions_backend(request, user_profile)
 | 
			
		||||
 | 
			
		||||
@authenticated_json_post_view
 | 
			
		||||
def json_add_subscriptions(request, user_profile):
 | 
			
		||||
    return add_subscriptions_backend(request, user_profile)
 | 
			
		||||
 
 | 
			
		||||
@@ -143,7 +143,6 @@ urlpatterns += patterns('zerver.views',
 | 
			
		||||
    url(r'^api/v1/get_profile$',            'api_get_profile'),
 | 
			
		||||
    url(r'^api/v1/get_old_messages$',       'api_get_old_messages'),
 | 
			
		||||
    url(r'^api/v1/get_public_streams$',     'api_get_public_streams'),
 | 
			
		||||
    url(r'^api/v1/subscriptions/add$',      'api_add_subscriptions'),
 | 
			
		||||
    url(r'^api/v1/send_message$',           'api_send_message'),
 | 
			
		||||
    url(r'^api/v1/update_pointer$',         'api_update_pointer'),
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user