Skip to content

Commit 010d1de

Browse files
committed
[slack] Fix pylint issue
1 parent 2502814 commit 010d1de

File tree

1 file changed

+2
-4
lines changed
  • desktop/core/src/desktop/lib/botserver

1 file changed

+2
-4
lines changed

desktop/core/src/desktop/lib/botserver/views.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
from desktop.lib.exceptions_renderable import PopupException
2727
from desktop.models import Document2, _get_gist_document
2828

29-
from notebook.decorators import check_document_access_permission
30-
3129
from django.http import HttpResponse
3230
from django.utils.translation import ugettext as _
3331
from django.views.decorators.csrf import csrf_exempt
@@ -91,7 +89,6 @@ def handle_on_message(channel_id, bot_id, text, user_id):
9189
if not response['ok']:
9290
raise PopupException(_("Error posting message"), detail=response["error"])
9391

94-
@check_document_access_permission
9592
def handle_on_link_shared(channel_id, message_ts, links):
9693
for item in links:
9794
path = urlsplit(item['url'])[2]
@@ -110,7 +107,8 @@ def handle_on_link_shared(channel_id, message_ts, links):
110107
dialect = doc_data['dialect'].capitalize() if id_type == 'editor' else doc.extra.capitalize()
111108
created_by = doc.owner.get_full_name() or doc.owner.username
112109
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))
114112

115113
payload = _make_unfurl_payload(item['url'], statement, dialect, created_by)
116114
response = slack_client.chat_unfurl(channel=channel_id, ts=message_ts, unfurls=payload)

0 commit comments

Comments
 (0)