From 83dcbf1fb73c46186f136f1bb831080febefc85d Mon Sep 17 00:00:00 2001 From: Sean Callan Date: Mon, 21 Jan 2019 11:37:45 -0700 Subject: [PATCH] Correct pattern matching (#16) * Correct pattern matching * Add missing gettext message --- lib/admissions/registrar.ex | 2 +- priv/gettext/default.pot | 4 ++-- priv/gettext/en/LC_MESSAGES/default.po | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/admissions/registrar.ex b/lib/admissions/registrar.ex index 2e0d096..5cc68b5 100644 --- a/lib/admissions/registrar.ex +++ b/lib/admissions/registrar.ex @@ -20,7 +20,7 @@ defmodule Admissions.Registrar do end defp contributor?(client, nickname, org, repo) do - with {_status_code, contributors, _http_response} <- Contributors.list(client, org, repo) + with contributors when is_list(contributors) <- Contributors.list(client, org, repo) do Enum.any?(contributors, &(Map.get(&1, "login") == nickname)) else diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 2e28bfb..137680c 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -50,10 +50,10 @@ msgstr "" #, elixir-format #: lib/admissions_web/templates/registrar/eligible.html.eex:2 -msgid "eligible_title" +msgid "eligible_title %{nickname}" msgstr "" #, elixir-format #: lib/admissions_web/templates/registrar/ineligible.html.eex:2 -msgid "eligible_title %{nickname}" +msgid "ineligible_title" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 5a09e68..3235b76 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -58,3 +58,8 @@ msgstr "Thank you for your contributions, this wouldn’t be the same without yo #: lib/admissions_web/templates/registrar/ineligible.html.eex:2 msgid "eligible_title %{nickname}" msgstr "🎉 You're eligible, %{nickname}!" + +#, elixir-format +#: lib/admissions_web/templates/registrar/ineligible.html.eex:2 +msgid "ineligible_title" +msgstr "Currently ineligible"