forked from shibao/cannery
		
	fix bug with public registration
This commit is contained in:
		@@ -384,7 +384,7 @@ defmodule Cannery.Accounts do
 | 
			
		||||
  """
 | 
			
		||||
  @spec allow_registration?() :: boolean()
 | 
			
		||||
  def allow_registration? do
 | 
			
		||||
    Application.get_env(:Cannery, CanneryWeb.Endpoint)[:registration] == "public" or
 | 
			
		||||
    Application.get_env(:cannery, Cannery.Accounts)[:registration] == "public" or
 | 
			
		||||
      list_users_by_role(:admin) |> Enum.empty?()
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -105,8 +105,7 @@ defmodule CanneryWeb.HomeLive do
 | 
			
		||||
        <li class="flex flex-row justify-center space-x-2">
 | 
			
		||||
          <b>Registration:</b>
 | 
			
		||||
          <p>
 | 
			
		||||
            <%= Application.get_env(:cannery, CanneryWeb.Endpoint)[:registration]
 | 
			
		||||
            |> case do
 | 
			
		||||
            <%= case Application.get_env(:cannery, Cannery.Accounts)[:registration] do
 | 
			
		||||
              "public" -> gettext("Public Signups")
 | 
			
		||||
              _ -> gettext("Invite Only")
 | 
			
		||||
            end %>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user