Mercurial > hg > soundsoftware-site
changeset 582:7cca1ac03f0c feature_36
For "I am this author", always pull details from user not from a prior authorship
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Wed, 10 Aug 2011 17:19:36 +0100 |
parents | 7c06dde557ec |
children | 4ee092298206 |
files | vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb |
diffstat | 1 files changed, 7 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Wed Aug 10 16:23:55 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Wed Aug 10 17:19:36 2011 +0100 @@ -21,23 +21,14 @@ :author_user_id => self.id, :is_user => "1" } - - if self.author.nil? - logger.debug { "Bibliography: The current user has no author associated." } - info[:name_on_paper] = self.name - info[:email] = self.mail - if not self.ssamr_user_detail.nil? - info[:institution] = self.ssamr_user_detail.institution_name - end - else - logger.error { "Bibliography: We've got an author associated with the current user." } - info[:name_on_paper] = self.author.name - if self.author.authorships.length > 0 - info[:email] = self.author.authorships.first.email - info[:institution] = self.author.authorships.first.institution - end - end + info[:name_on_paper] = self.name + info[:email] = self.mail + + unless self.ssamr_user_detail.nil? + info[:institution] = self.ssamr_user_detail.institution_name + end + return info end