DEV: Remove unused code and translations

This commit is contained in:
Gerhard Schlager
2020-08-25 01:29:18 +02:00
committed by Gerhard Schlager
parent d684d5fba4
commit 6c09fd4289
7 changed files with 6 additions and 44 deletions

View File

@ -470,18 +470,12 @@ class GroupsController < ApplicationController
end
def request_membership
params.require(:reason) if params[:topic_id].blank?
params.require(:reason)
group = find_group(:id)
if params[:topic_id] && topic = Topic.find_by_id(params[:topic_id])
reason = I18n.t("groups.view_hidden_topic_request_reason", group_name: group.name, topic_url: topic.url)
end
reason ||= params[:reason]
begin
GroupRequest.create!(group: group, user: current_user, reason: reason)
GroupRequest.create!(group: group, user: current_user, reason: params[:reason])
rescue ActiveRecord::RecordNotUnique => e
return render json: failed_json.merge(error: I18n.t("groups.errors.already_requested_membership")), status: 409
end