26
26
from desktop .lib .exceptions_renderable import PopupException
27
27
from desktop .models import Document2 , _get_gist_document
28
28
29
- from notebook .decorators import check_document_access_permission
30
-
31
29
from django .http import HttpResponse
32
30
from django .utils .translation import ugettext as _
33
31
from django .views .decorators .csrf import csrf_exempt
@@ -91,7 +89,6 @@ def handle_on_message(channel_id, bot_id, text, user_id):
91
89
if not response ['ok' ]:
92
90
raise PopupException (_ ("Error posting message" ), detail = response ["error" ])
93
91
94
- @check_document_access_permission
95
92
def handle_on_link_shared (channel_id , message_ts , links ):
96
93
for item in links :
97
94
path = urlsplit (item ['url' ])[2 ]
@@ -110,7 +107,8 @@ def handle_on_link_shared(channel_id, message_ts, links):
110
107
dialect = doc_data ['dialect' ].capitalize () if id_type == 'editor' else doc .extra .capitalize ()
111
108
created_by = doc .owner .get_full_name () or doc .owner .username
112
109
except Document2 .DoesNotExist :
113
- raise PopupException (_ ("Document with {key}={value} does not exist" ).format (key = 'uuid' if id_type == 'uuid' else 'id' , value = qid_or_uuid ))
110
+ msg = "Document with {key}={value} does not exist" .format (key = 'uuid' if id_type == 'uuid' else 'id' , value = qid_or_uuid )
111
+ raise PopupException (_ (msg ))
114
112
115
113
payload = _make_unfurl_payload (item ['url' ], statement , dialect , created_by )
116
114
response = slack_client .chat_unfurl (channel = channel_id , ts = message_ts , unfurls = payload )
0 commit comments