mirror of
https://github.com/YunoHost/dynette.git
synced 2024-09-03 20:06:17 +02:00
bugfix
This commit is contained in:
parent
d39dfae312
commit
dc07f45e9e
2 changed files with 6 additions and 2 deletions
BIN
.dynette.rb.swp
BIN
.dynette.rb.swp
Binary file not shown.
|
@ -43,8 +43,12 @@ post '/' do
|
||||||
|
|
||||||
# If already exists
|
# If already exists
|
||||||
status 409
|
status 409
|
||||||
return { :error => "Subdomain already taken: #{entry.subdomain}.#{DOMAIN}" } if entry = Entry.first(:subdomain => params[:subdomain])
|
if entry = Entry.first(:subdomain => params[:subdomain])
|
||||||
return { :error => "Key already exists for domain #{entry.subdomain}.#{DOMAIN}" } if entry = Entry.first(:public_key => params[:public_key])
|
return { :error => "Subdomain already taken: #{entry.subdomain}.#{DOMAIN}" }
|
||||||
|
end
|
||||||
|
if entry = Entry.first(:public_key => params[:public_key])
|
||||||
|
return { :error => "Key already exists for domain #{entry.subdomain}.#{DOMAIN}" }
|
||||||
|
end
|
||||||
|
|
||||||
# Process
|
# Process
|
||||||
entry = Entry.new(:public_key => params[:public_key], :subdomain => params[:subdomain], :current_ip => request.ip)
|
entry = Entry.new(:public_key => params[:public_key], :subdomain => params[:subdomain], :current_ip => request.ip)
|
||||||
|
|
Loading…
Reference in a new issue