Browse Source

Merge branch 'dev_trustie' of http://gitea.trustie.net/jasder/forgeplus into dev_trustie

tags/v1
Jasder 6 years ago
parent
commit
38dd7b87d8
6 changed files with 15 additions and 3 deletions
  1. +1
    -1
      app/controllers/issues_controller.rb
  2. +1
    -1
      app/jobs/change_token_job.rb
  3. +2
    -0
      app/models/user.rb
  4. +10
    -1
      app/views/repositories/commits.json.jbuilder
  5. +1
    -0
      app/views/users/get_user_info.json.jbuilder
  6. BIN
      dump.rdb

+ 1
- 1
app/controllers/issues_controller.rb View File

@@ -145,7 +145,7 @@ class IssuesController < ApplicationController
change_params = {
change_type: "minusToken",
tokens: params[:token]
}.merge(tokens_params(@proeject))
}.merge(tokens_params(@project))
ChangeTokenJob.perform_later(change_params)
end



+ 1
- 1
app/jobs/change_token_job.rb View File

@@ -15,7 +15,7 @@ class ChangeTokenJob < ApplicationJob
end
end
unless status == 200
Rails.logger.info("########_change_user_toke_failed__change_params:__#{change_parame}_")
Rails.logger.info("########_change_user_toke_failed__change_params:__#{change_params}_")
end
end


+ 2
- 0
app/models/user.rb View File

@@ -96,6 +96,8 @@ class User < ApplicationRecord
where("LOWER(concat(lastname, firstname, login, mail)) LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank?
}

scope :simple_select, -> {select(:id, :login, :lastname,:firstname, :nickname, :gitea_uid)}

attr_accessor :password, :password_confirmation

delegate :gender, :department_id, :school_id, :location, :location_city, :technical_title, to: :user_extension, allow_nil: true


+ 10
- 1
app/views/repositories/commits.json.jbuilder View File

@@ -5,11 +5,20 @@ else
json.total_count @hash_commit[:total_count]
json.commits do
json.array! @hash_commit[:body] do |commit|
commiter = commit['committer']
if commiter.present?
commit_user_id = commiter['id']
forge_user = User.simple_select.find_by(gitea_uid: commit_user_id)
end
json.sha commit['sha']
json.message commit['commit']['message']
json.timestamp render_unix_time(commit['commit']['author']['date'])
json.time_from_now time_from_now(commit['commit']['author']['date'])
json.partial! 'author', user: @project_owner
if forge_user
json.partial! 'author', user: forge_user
else
json.author nil
end
end
end
end

+ 1
- 0
app/views/users/get_user_info.json.jbuilder View File

@@ -12,5 +12,6 @@ json.user_phone_binded @user.phone.present?
# json.email @user.mail
json.profile_completed @user.profile_completed?
json.professional_certification @user.professional_certification
json.is_watch current_user&.watched?(@user)

BIN
dump.rdb View File


Loading…
Cancel
Save