diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-15 15:34:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-15 15:34:14 +0000 |
commit | 24c361eb0a122e4a86621879539a067cea068a12 (patch) | |
tree | 1eb7ca6b7805ff35e5feb8bfbccab411a77330a3 /app/models/user.rb | |
parent | 9817e1d744eccc1f715564015cde80672906ba3e (diff) | |
download | redmine-24c361eb0a122e4a86621879539a067cea068a12.tar.gz redmine-24c361eb0a122e4a86621879539a067cea068a12.zip |
Fixed that rss key is generated twice when user is not reloaded (#10668).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9419 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index b377dda67..6e7e94cf6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -284,14 +284,18 @@ class User < Principal # Return user's RSS key (a 40 chars long string), used to access feeds def rss_key - token = self.rss_token || Token.create(:user => self, :action => 'feeds') - token.value + if rss_token.nil? + create_rss_token(:action => 'feeds') + end + rss_token.value end # Return user's API key (a 40 chars long string), used to access the API def api_key - token = self.api_token || self.create_api_token(:action => 'api') - token.value + if api_token.nil? + create_api_token(:action => 'api') + end + api_token.value end # Return an array of project ids for which the user has explicitly turned mail notifications on |