Don't crash on requesting a non-existent email address
This commit is contained in:
parent
361adda6cd
commit
dc1dd07720
5 changed files with 8 additions and 17 deletions
|
|
@ -33,7 +33,6 @@ class GroupsController < ApplicationController
|
||||||
@group = Group.first(:id => params[:id])
|
@group = Group.first(:id => params[:id])
|
||||||
|
|
||||||
@posts = current_user.visible_posts( :by_members_of => @group ).paginate :order => 'created_at DESC'
|
@posts = current_user.visible_posts( :by_members_of => @group ).paginate :order => 'created_at DESC'
|
||||||
#@posts = Post.paginate :person_id => @people_ids, :order => 'created_at DESC'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,13 @@ class RequestsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
puts params.inspect
|
begin
|
||||||
rel_hash = relationship_flow(params[:request][:destination_url])
|
rel_hash = relationship_flow(params[:request][:destination_url])
|
||||||
|
rescue Exception => e
|
||||||
|
flash[:error] = "no diaspora seed found with this email!"
|
||||||
|
redirect_to current_user.group_by_id(params[:request][:group_id])
|
||||||
|
return
|
||||||
|
end
|
||||||
Rails.logger.debug("Sending request: #{rel_hash}")
|
Rails.logger.debug("Sending request: #{rel_hash}")
|
||||||
@request = current_user.send_request(rel_hash, params[:request][:group_id])
|
@request = current_user.send_request(rel_hash, params[:request][:group_id])
|
||||||
|
|
||||||
|
|
@ -45,8 +50,7 @@ class RequestsController < ApplicationController
|
||||||
else
|
else
|
||||||
flash[:error] = "you have already friended this person"
|
flash[:error] = "you have already friended this person"
|
||||||
end
|
end
|
||||||
@request = Request.new
|
redirect_to current_user.group_by_id(params[:request][:group_id])
|
||||||
render :action => 'new'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ module RequestsHelper
|
||||||
action = :none
|
action = :none
|
||||||
url = nil
|
url = nil
|
||||||
local_person = Person.by_webfinger identifier
|
local_person = Person.by_webfinger identifier
|
||||||
puts local_person.inspect
|
|
||||||
if local_person
|
if local_person
|
||||||
action = (local_person == current_user.person ? :none : :friend)
|
action = (local_person == current_user.person ? :none : :friend)
|
||||||
url = local_person.receive_url
|
url = local_person.receive_url
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
= form_for @request do |f|
|
|
||||||
= f.error_messages
|
|
||||||
|
|
||||||
.field_with_submit
|
|
||||||
= f.text_field :destination_url
|
|
||||||
= f.submit
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
%h1 requests
|
|
||||||
|
|
||||||
= render 'form'
|
|
||||||
|
|
||||||
%p= link_to "Back to List", requests_path
|
|
||||||
Loading…
Reference in a new issue