From f3d38151660f9b94552a2f4e4f2597ded6204ffa Mon Sep 17 00:00:00 2001 From: Blog Manager Robot Date: Sat, 29 Oct 2022 21:17:27 +0000 Subject: [PATCH] Updated. --- Web/lib/MJB/Web/Controller/Blog.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Web/lib/MJB/Web/Controller/Blog.pm b/Web/lib/MJB/Web/Controller/Blog.pm index eb51e7a..3ecb26f 100644 --- a/Web/lib/MJB/Web/Controller/Blog.pm +++ b/Web/lib/MJB/Web/Controller/Blog.pm @@ -7,6 +7,9 @@ sub create ($c) { } sub do_create ($c) { + $c->stash->{template} = 'blog/create'; + + my $domain_type = $c->stash->{form_domain_type} = $c->param('domain_type'); my $domain = $c->stash->{form_owned_domain} = $c->param('owned_domain'); my $subdomain = $c->stash->{form_hosted_subdomain} = $c->param('hosted_subdomain'); @@ -26,6 +29,12 @@ sub do_create ($c) { return if $c->stash->{errors}; $domain = $domain ? $domain : $subdomain . '.' . $c->config->{customer_domain}; + + # Do we already have this domain name? + if ( $c->db->domain( { name => $domain } ) ) { + push @{$c->stash->{errors}}, "That domain name has been taken."; + return; + } # Create the Jekyll repo for the site my $jekyll = $c->jekyll($domain)->init;