summaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-12-30 00:25:53 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-12-30 00:25:53 +0000
commit4b3d4553e4388b4cda6d6cc5cfaa5418b45e7d26 (patch)
treecba51c537eee88747e903f259fab066f75f12a29 /app/models/user.rb
parentc67cc7c2851b6b932c1e575cdd6a48173ae82559 (diff)
downloadredmine-4b3d4553e4388b4cda6d6cc5cfaa5418b45e7d26.tar.gz
redmine-4b3d4553e4388b4cda6d6cc5cfaa5418b45e7d26.zip
Create and assign the api token so the current instance can access it. (#4497)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3265 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 39fdb165a..8a69fda00 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -196,7 +196,7 @@ class User < Principal
# Return user's API key (a 40 chars long string), used to access the API
def api_key
- token = self.api_token || Token.create(:user => self, :action => 'api')
+ token = self.api_token || self.create_api_token(:action => 'api')
token.value
end