diff --git a/app/models/user.rb b/app/models/user.rb index 3f37ab1ea..5ca3356b6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -773,7 +773,7 @@ class User < Owner end def profile_is_completed? - self.nickname.present? && self.gender.present? && self.mail.present? && self.custom_department.present? + self.nickname.present? && self.mail.present? end protected diff --git a/app/views/pull_requests/_commit.json.jbuilder b/app/views/pull_requests/_commit.json.jbuilder index 52b776008..2cd2bab78 100644 --- a/app/views/pull_requests/_commit.json.jbuilder +++ b/app/views/pull_requests/_commit.json.jbuilder @@ -1,12 +1,27 @@ -json.author do - json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Author']), name: commit['Author']['Name'] } -end +if commit['Status'].present? + json.author do + json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Author']), name: commit['Author']['Name'] } + end + + json.committer do + json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] } + end + json.timestamp render_unix_time(commit['Committer']['When']) + json.time_from_now time_from_now(commit['Committer']['When']) + json.created_at render_format_time_with_date(commit['Committer']['When']) + json.message commit['CommitMessage'] + json.sha commit['Sha'] +else + json.author do + json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['commit']['author']), name: commit['commit']['author']['name'] } + end -json.committer do - json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['Committer']), name: commit['Committer']['Name'] } -end -json.timestamp render_unix_time(commit['Committer']['When']) -json.time_from_now time_from_now(commit['Committer']['When']) -json.created_at render_format_time_with_date(commit['Committer']['When']) -json.message commit['CommitMessage'] -json.sha commit['Sha'] + json.committer do + json.partial! 'repositories/commit_author', locals: { user: render_cache_commit_author(commit['commit']['committer']), name: commit['commit']['committer']['name'] } + end + json.timestamp render_unix_time(commit['commit']['committer']['date']) + json.time_from_now time_from_now(commit['commit']['committer']['date']) + json.created_at render_format_time_with_date(commit['commit']['committer']['date']) + json.message commit['commit']['message'] + json.sha commit['sha'] +end \ No newline at end of file