merge from develop

This commit is contained in:
yystopf 2022-01-24 10:06:20 +08:00
commit 67914201bf
4 changed files with 16 additions and 7 deletions

View File

@ -27,11 +27,11 @@ class IssuesController < ApplicationController
@filter_issues = @filter_issues.where("subject LIKE ? OR description LIKE ? ", "%#{params[:search]}%", "%#{params[:search]}%") if params[:search].present?
@open_issues = @all_issues.where.not(status_id: IssueStatus::CLOSED)
@close_issues = @all_issues.where(status_id: IssueStatus::CLOSED)
@assign_to_me = @filter_issues.where(assigned_to_id: current_user&.id)
@my_published = @filter_issues.where(author_id: current_user&.id)
scopes = Issues::ListQueryService.call(issues,params.delete_if{|k,v| v.blank?}, "Issue")
@issues_size = scopes.size
@issues = paginate(scopes)
@assign_to_me = @issues.where(assigned_to_id: current_user&.id)
@my_published = @issues.where(author_id: current_user&.id)
respond_to do |format|
format.json

View File

@ -150,8 +150,11 @@ class RepositoriesController < ApplicationController
if params[:filepath].present? || @project.educoder?
@contributors = []
else
@contributors = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier)
result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier)
@contributors = result.is_a?(Hash) && result.key?(:status) ? [] : result
end
rescue
@contributors = []
end
def edit

View File

@ -9,9 +9,7 @@ module Register
validate :check!
def check!
Rails.logger.info "Register::Form params: code: #{code}; login: #{login};
namespace: #{namespace}; password: #{password}; password_confirmation: #{password_confirmation}"
Rails.logger.info "Register::Form params: code: #{code}; login: #{login}; namespace: #{namespace}; password: #{password}; type: #{type}"
type = phone_mail_type(strip(login))
db_verifi_code =
if type == 1

View File

@ -49,6 +49,14 @@ if @result[:repo]
json.empty @result[:repo]['empty']
json.full_name @result[:repo]['full_name']
json.private @result[:repo]['private']
else
json.size 0
json.ssh_url nil
json.clone_url nil
json.default_branch 'master'
json.empty nil
json.full_name nil
json.private !@project.is_public
end
json.license_name @project.license_name
json.branches_count @result[:branch_tag_total_count].present? ? (@result[:branch_tag_total_count]['branch_count'] || 0) : 0