summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/User.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 50a4e62b7..c9535d7bf 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -107,7 +107,14 @@ sub _create {
$id);
if ($result) {
+ my $is_main_db;
+ unless ($is_main_db = Bugzilla->dbwritesallowed()) {
+ Bugzilla->switch_to_main_db();
+ }
$self->derive_groups($tables_locked_for_derive_groups);
+ unless ($is_main_db) {
+ Bugzilla->switch_to_shadow_db();
+ }
}
return $self;