summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla.pm5
-rw-r--r--Bugzilla/Template.pm2
2 files changed, 7 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 52a44e375..cd6cc7a37 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -574,6 +574,11 @@ sub switch_to_main_db {
return $class->dbh_main;
}
+sub is_shadow_db {
+ my $class = shift;
+ return $class->request_cache->{dbh} != $class->dbh_main;
+}
+
sub fields {
my ($class, $criteria) = @_;
$criteria ||= {};
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 9f007bb6d..17d4008f7 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -1040,6 +1040,8 @@ sub create {
'get_api_token' => sub {
return '' unless Bugzilla->user->id;
+ # BMO - hack so we don't create tokens when pointing to the shadow_db
+ return '' if Bugzilla->is_shadow_db;
my $cache = Bugzilla->request_cache;
return $cache->{api_token} //= issue_api_token();
},