From 36253a9caf249e502e1c151a95d4c4f8b8398b8f Mon Sep 17 00:00:00 2001 From: Natalie Rose Date: Wed, 9 Sep 2026 14:08:23 +1000 Subject: [PATCH] Fix circular import --- .dockerignore | 4 ---- lib/Lacuna/DB/Result/Empire.pm | 2 +- lib/Lacuna/Mailer.pm | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index f2daead2..b10bc18a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,9 +5,5 @@ .vscode **/node_modules local -homepage/ -app/ -assets/ -super-ui/ # Runtime log tree (bind-mounted at run time; the server image mkdir's its own). log diff --git a/lib/Lacuna/DB/Result/Empire.pm b/lib/Lacuna/DB/Result/Empire.pm index 268c8ba6..03412272 100644 --- a/lib/Lacuna/DB/Result/Empire.pm +++ b/lib/Lacuna/DB/Result/Empire.pm @@ -985,7 +985,7 @@ sub invite_friend { Lacuna->config->get('server_url').'#referral='.$code, Lacuna->config->get('server_url'); my $mailer = Lacuna::Mailer->new; - $mailer->from = $self->email; + $mailer->from($self->email); $mailer->send($email, 'Come Play With Me', $message); } diff --git a/lib/Lacuna/Mailer.pm b/lib/Lacuna/Mailer.pm index 5f1b90db..173a8b44 100644 --- a/lib/Lacuna/Mailer.pm +++ b/lib/Lacuna/Mailer.pm @@ -2,7 +2,6 @@ package Lacuna::Mailer; use Moose; use utf8; -use Lacuna; use LWP::UserAgent; use Data::Dumper; use MIME::Base64; @@ -18,7 +17,7 @@ has from => ( has api_key => ( is => 'ro', lazy => 1, - default => sub { return Lacuna->config->get('mailgun/api_key'); }, + default => sub { require Lacuna; return Lacuna->config->get('mailgun/api_key'); }, ); # Sends mail using mailgun and configured API key -- 2.51.2