mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
slack_import: Show validation error on empty slack access token.
We used to rely on browser to show error for empty slack access token, but now we are using our own error element for this.
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<label for="slack_access_token" class="inline-block label-title">{{ _('Slack bot user OAuth token') }}</label>
|
||||
<input id="slack-access-token" type="text"
|
||||
placeholder="xoxb-…"
|
||||
maxlength="100" name="slack_access_token" required {% if slack_access_token %} value="{{ slack_access_token }}" {% endif %} />
|
||||
maxlength="100" name="slack_access_token" {% if slack_access_token %} value="{{ slack_access_token }}" {% endif %} />
|
||||
{% if slack_access_token_validation_error %}
|
||||
<p id="slack-access-token-validation-error" class="help-inline text-error">{{ slack_access_token_validation_error }}</p>
|
||||
{% endif %}
|
||||
|
||||
@@ -361,8 +361,8 @@ def registration_helper(
|
||||
}
|
||||
|
||||
saved_slack_access_token = prereg_realm.data_import_metadata.get("slack_access_token")
|
||||
if saved_slack_access_token or slack_access_token:
|
||||
if slack_access_token and slack_access_token != saved_slack_access_token:
|
||||
if saved_slack_access_token or slack_access_token is not None:
|
||||
if slack_access_token is not None and slack_access_token != saved_slack_access_token:
|
||||
# Verify slack token access.
|
||||
from zerver.data_import.slack import (
|
||||
SLACK_IMPORT_TOKEN_SCOPES,
|
||||
|
||||
Reference in New Issue
Block a user