# HG changeset patch # User Chris Cannam # Date 1312993176 -3600 # Node ID 7cca1ac03f0c0f95048030190c48b73f31cdc26e # Parent 7c06dde557ecd8b1859c40454b5b05469847867b For "I am this author", always pull details from user not from a prior authorship diff -r 7c06dde557ec -r 7cca1ac03f0c vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb --- 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