diff options
author | bugreport%peshkin.net <> | 2004-05-14 22:55:45 +0200 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-05-14 22:55:45 +0200 |
commit | 680ffe30d46b1b9921ab1419ac5906a3513a78d5 (patch) | |
tree | 50d0a5c93028075a4eb6c532d2a6eb61725a13cf | |
parent | 0f65460c98b3b69e4d884adbd20630ce99416d74 (diff) | |
download | bugzilla-680ffe30d46b1b9921ab1419ac5906a3513a78d5.tar.gz bugzilla-680ffe30d46b1b9921ab1419ac5906a3513a78d5.tar.xz |
Bug 239263: Avoid hazard in User->groups by switching to main DB for rederive
r=jouni
a=justdave
-rw-r--r-- | Bugzilla/User.pm | 7 |
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; |