Flip the prod to stage redirect for the armooo@dropbox.com

This change will redirect armooo@dropbox.com from stage to prod. It also
removes the prod to stage redirect for all users. This will be rolled
out in two commits to prevent a redirect loop.

(imported from commit c290b630e746f757429b8bbdadbe7768367a5e33)
This commit is contained in:
Jason Michalski
2015-02-05 17:19:14 -05:00
parent eb1631f78d
commit 693857a1f8
2 changed files with 11 additions and 11 deletions

View File

@@ -20,22 +20,22 @@
to use <a href="https://zephyr.zulip.com">the web interface</a></span>
</div>
<div class="alert alert_sidebar alert-error home-error-bar" id="home-error"></div>
{% if send_to_staging %}
{% if send_to_prod %}
<div id="staging-warning"class="alert alert_sidebar alert-error">
<p>This realm uses staging. Please login into
<a href="https://staging.zulip.com/">staging.zulip.com</a>
<p>This realm uses production. Please login into
<a href="https://zulip.com/">zulip.com</a>
to be part of the conversation.</p>
</div>
<script>
$(function () {
if (window.bridge !== undefined) {
// Desktop app only supports "prompt", not "alert" or "confirm" :/
window.prompt("You're currently on the production {{product_name}} server, but everyone else is on the staging server.\n\nGoing forward, please run {{product_name}} with the following flag to use the staging server:", "--site https://staging.zulip.com");
window.location.assign("https://staging.zulip.com");
window.prompt("You're currently on the staging {{product_name}} server, but everyone else is on the production server.\n\nGoing forward, please run {{product_name}} with the following flag to use the staging server:", "--site https://zulip.com");
window.location.assign("https://zulip.com");
} else {
var res = window.confirm("You're currently on the production {{product_name}} server, but everyone else is on the staging server. Please use https://staging.zulip.com to use {{product_name}}.");
var res = window.confirm("You're currently on the staging {{product_name}} server, but everyone else is on the product_name server. Please use https://zulip.com to use {{product_name}}.");
if (feature_flags.is_og_zulip_user && !res) { return; }
window.location.assign("https://staging.zulip.com");
window.location.assign("https://zulip.com");
}
});
</script>

View File

@@ -1001,9 +1001,9 @@ def home(request):
show_invites = False
# Warn users on the zulip.com realm to use staging.
send_to_staging = False
if page_params['domain'] == "zulip.com" and not page_params['staging']:
send_to_staging = True
send_to_prod = False
if page_params['domain'] == "zulip.com" and page_params['staging'] and user_profile.email == 'armooo@dropbox.com':
send_to_prod = True
dbx_branding = False
product_name = "Zulip"
@@ -1025,7 +1025,7 @@ def home(request):
'show_webathena': user_profile.realm.domain == "mit.edu",
'enable_feedback': settings.ENABLE_FEEDBACK,
'embedded': narrow_stream is not None,
'send_to_staging': send_to_staging,
'send_to_prod': send_to_prod,
'dbx_branding': dbx_branding,
'product_name': product_name
},