DEV: Remove unused code and translations
This commit is contained in:
committed by
Gerhard Schlager
parent
d684d5fba4
commit
6c09fd4289
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user