mirror of https://github.com/zulip/zulip.git
webhooks: Import REQ, has_request_variables from zerver.lib.request.
We now import REQ and has_request_variables from zerver.lib.request, which is where these methods are defined. Fixes #7195.
This commit is contained in:
parent
20f3e9b779
commit
aaaed74c3d
|
@ -2,9 +2,10 @@
|
|||
from typing import Dict, Any, Text
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
AIRBRAKE_SUBJECT_TEMPLATE = '{project_name}'
|
||||
|
|
|
@ -4,9 +4,10 @@ import re
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from typing import Dict, Any, Text
|
||||
|
|
|
@ -3,9 +3,10 @@ import logging
|
|||
from typing import Any, Dict, Text
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from .support_event import SUPPORT_EVENTS
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
# Webhooks for external integrations.
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.models import get_client, UserProfile
|
||||
from zerver.decorator import authenticated_rest_api_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict
|
||||
from zerver.decorator import REQ, has_request_variables, authenticated_rest_api_view
|
||||
from zerver.models import get_client, UserProfile
|
||||
|
||||
import base64
|
||||
from functools import wraps
|
||||
|
|
|
@ -2,12 +2,13 @@ from typing import Any, Mapping, Text, Optional
|
|||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.models import get_client, UserProfile
|
||||
from zerver.decorator import authenticated_rest_api_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict
|
||||
from zerver.decorator import REQ, has_request_variables, authenticated_rest_api_view
|
||||
from zerver.lib.webhooks.git import get_push_commits_event_message, SUBJECT_WITH_BRANCH_TEMPLATE
|
||||
from zerver.models import get_client, UserProfile
|
||||
|
||||
|
||||
@authenticated_rest_api_view(is_webhook=True)
|
||||
|
|
|
@ -5,9 +5,10 @@ from six.moves import zip
|
|||
from typing import Any, Callable, Dict, List, Optional, Text
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
from zerver.lib.webhooks.git import get_push_commits_event_message, SUBJECT_WITH_BRANCH_TEMPLATE,\
|
||||
get_force_push_commits_event_message, get_remove_branch_event_message, get_pull_request_event_message,\
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from typing import Any, Dict, Text
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
import ujson
|
||||
|
|
|
@ -4,9 +4,10 @@ from django.utils.translation import ugettext as _
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from typing import Any, Dict
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
import ujson
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
# Webhooks for external integrations.
|
||||
from typing import Any, Dict, Text
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from typing import Any, Dict, Text
|
||||
|
||||
CRASHLYTICS_SUBJECT_TEMPLATE = '{display_id}: {title}'
|
||||
CRASHLYTICS_MESSAGE_TEMPLATE = '[Issue]({url}) impacts at least {impacted_devices_count} device(s).'
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# Webhooks for external integrations.
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.models import get_client, UserProfile
|
||||
|
||||
from zerver.decorator import authenticated_rest_api_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.decorator import REQ, has_request_variables, authenticated_rest_api_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import get_client, UserProfile
|
||||
|
||||
from typing import Text
|
||||
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from zerver.models import get_client, UserProfile
|
||||
from zerver.decorator import authenticated_rest_api_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.notifications import convert_html_to_markdown
|
||||
from zerver.decorator import REQ, has_request_variables, authenticated_rest_api_view
|
||||
from zerver.models import get_client, UserProfile
|
||||
|
||||
import logging
|
||||
import ujson
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
from django.conf import settings
|
||||
from zerver.models import get_client, UserProfile
|
||||
from zerver.decorator import authenticated_api_view, to_non_negative_int, flexible_boolean
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict
|
||||
from zerver.decorator import authenticated_api_view, REQ, has_request_variables, to_non_negative_int, flexible_boolean
|
||||
from zerver.views.messages import send_message_backend
|
||||
from zerver.lib.webhooks.git import get_push_commits_event_message,\
|
||||
SUBJECT_WITH_BRANCH_TEMPLATE, get_force_push_commits_event_message, \
|
||||
get_remove_branch_event_message, get_pull_request_event_message,\
|
||||
get_issue_event_message, SUBJECT_WITH_PR_OR_ISSUE_INFO_TEMPLATE,\
|
||||
get_commits_comment_action_message
|
||||
from zerver.models import get_client, UserProfile
|
||||
from zerver.views.messages import send_message_backend
|
||||
|
||||
import logging
|
||||
import re
|
||||
import ujson
|
||||
|
|
|
@ -3,11 +3,11 @@ import logging
|
|||
from functools import partial
|
||||
from typing import Any, Callable, Text, Dict, Optional
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.request import JsonableError
|
||||
from zerver.lib.request import JsonableError, REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
from zerver.decorator import api_key_only_webhook_view, REQ, has_request_variables
|
||||
|
||||
from zerver.lib.webhooks.git import get_issue_event_message, SUBJECT_WITH_PR_OR_ISSUE_INFO_TEMPLATE,\
|
||||
get_pull_request_event_message, SUBJECT_WITH_BRANCH_TEMPLATE,\
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from functools import partial
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.decorator import api_key_only_webhook_view, REQ, has_request_variables
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.webhooks.git import get_push_commits_event_message, EMPTY_SHA,\
|
||||
get_remove_branch_event_message, get_pull_request_event_message,\
|
||||
get_issue_event_message, SUBJECT_WITH_PR_OR_ISSUE_INFO_TEMPLATE,\
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vim:fenc=utf-8
|
||||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.models import UserProfile
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.webhooks.git import get_push_commits_event_message, \
|
||||
get_pull_request_event_message, get_create_branch_event_message, \
|
||||
SUBJECT_WITH_BRANCH_TEMPLATE, SUBJECT_WITH_PR_OR_ISSUE_INFO_TEMPLATE
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from typing import Dict, Any, Iterable, Optional, Text
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@ from django.utils.translation import ugettext as _
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
import ujson
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Webhooks for external integrations.
|
||||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict, check_string
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
|
|
@ -3,9 +3,10 @@ from typing import Text
|
|||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict, check_string
|
||||
|
||||
from zerver.models import UserProfile
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from typing import Any, Callable, Dict
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
||||
|
|
|
@ -6,10 +6,11 @@ from django.db.models import Q
|
|||
from django.conf import settings
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.models import UserProfile, get_user, Realm
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import api_key_only_webhook_view, has_request_variables, REQ
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile, get_user, Realm
|
||||
|
||||
import logging
|
||||
import re
|
||||
|
|
|
@ -6,8 +6,9 @@ from django.utils.timezone import utc as timezone_utc
|
|||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view, REQ, has_request_variables
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Webhooks for external integrations.
|
||||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict, check_string
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
|
|
@ -4,10 +4,11 @@ from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Text
|
|||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.models import UserProfile, Stream
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict, check_string
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Webhooks for external integrations.
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import Client, UserProfile
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict, check_string
|
||||
|
||||
from zerver.models import UserProfile
|
||||
|
|
|
@ -4,9 +4,10 @@ from typing import Any, Dict, Text
|
|||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
import ujson
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import api_key_only_webhook_view, REQ, has_request_variables
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from defusedxml.ElementTree import fromstring as xml_fromstring
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from zerver.models import get_client
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.models import UserProfile
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile, get_client
|
||||
import ujson
|
||||
|
||||
from typing import Any, Dict
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# Webhooks for external integrations.
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
from typing import Any, Dict
|
||||
|
||||
@api_key_only_webhook_view('Sentry')
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message, create_stream_if_needed
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_string, check_int
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.models import UserProfile
|
||||
|
||||
ZULIP_MESSAGE_TEMPLATE = u"**{message_sender}**: `{text}`"
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile, Client
|
||||
|
||||
from typing import Any, Dict
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Webhooks for external integrations.
|
||||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict, check_string
|
||||
from zerver.models import UserProfile, MAX_SUBJECT_LENGTH
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Webhooks for external integrations.
|
||||
from django.utils.translation import ugettext as _
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
|
|
@ -23,9 +23,10 @@ from typing import Any, Dict, List, Mapping, Optional, Tuple, Text
|
|||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
import ujson
|
||||
|
|
|
@ -4,11 +4,11 @@ from django.db.models import Q
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from zerver.models import UserProfile, Realm
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_private_message, check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile, Realm
|
||||
|
||||
import logging
|
||||
import ujson
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
# Webhooks for external integrations.
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from typing import Optional
|
||||
|
||||
@api_key_only_webhook_view('Transifex')
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.lib.validator import check_dict, check_string, check_bool
|
||||
from zerver.models import UserProfile
|
||||
from typing import Dict
|
||||
|
|
|
@ -3,11 +3,11 @@ import ujson
|
|||
from typing import Mapping, Any, Tuple, Text, Optional
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.decorator import api_key_only_webhook_view, return_success_on_head_request
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.decorator import return_success_on_head_request
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
|
||||
from .card_actions import SUPPORTED_CARD_ACTIONS, process_card_action
|
||||
from .board_actions import SUPPORTED_BOARD_ACTIONS, process_board_action
|
||||
|
|
|
@ -5,10 +5,11 @@ from typing import Any, Dict, List
|
|||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.exceptions import JsonableError
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile, Client
|
||||
|
||||
SUBJECT_TEMPLATE = "{service_url}"
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
# Webhooks for external integrations.
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.models import get_client, UserProfile
|
||||
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import get_client, UserProfile
|
||||
|
||||
from six import text_type
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Webhooks for external integrations.
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_private_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.models import get_user
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.models import UserProfile
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import get_user, UserProfile
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from typing import Optional
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from django.utils.translation import ugettext as _
|
||||
from typing import Any, Callable, Dict
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from zerver.decorator import api_key_only_webhook_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success, json_error
|
||||
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import UserProfile
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Webhooks for external integrations.
|
||||
from zerver.models import get_client, UserProfile
|
||||
from zerver.decorator import authenticated_rest_api_view
|
||||
from zerver.lib.actions import check_send_stream_message
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.decorator import authenticated_rest_api_view, REQ, has_request_variables
|
||||
from zerver.lib.request import REQ, has_request_variables
|
||||
from zerver.models import get_client, UserProfile
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from typing import Text
|
||||
|
||||
|
|
Loading…
Reference in New Issue