Avoid duplicate Config calls
authorMark Felder <feld@feld.me>
Fri, 8 Jan 2021 22:43:19 +0000 (16:43 -0600)
committerMark Felder <feld@feld.me>
Fri, 8 Jan 2021 23:32:42 +0000 (17:32 -0600)
lib/pleroma/upload.ex

index 101cfec983bbcb9bcd6930b2d2ea8bb0afb141e3..3061b2aed7fae26597419a2381d01f7d62702cc5 100644 (file)
@@ -233,6 +233,7 @@ defmodule Pleroma.Upload do
   def base_url do
     uploader = Config.get([Pleroma.Upload, :uploader])
     upload_base_url = Config.get([Pleroma.Upload, :base_url])
+    public_endpoint = Config.get([uploader, :public_endpoint])
 
     case uploader do
       Pleroma.Uploaders.Local ->
@@ -246,8 +247,8 @@ defmodule Pleroma.Upload do
 
       _ ->
         cond do
-          !is_nil(Config.get([uploader, :public_endpoint])) ->
-            Config.get([uploader, :public_endpoint])
+          !is_nil(public_endpoint) ->
+            public_endpoint
 
           true ->
             upload_base_url