mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
fix channel creation errors
This commit is contained in:
parent
9b22d2719a
commit
7473b92309
2 changed files with 4 additions and 5 deletions
|
@ -38,10 +38,9 @@ defmodule Philomena.Channels.Channel do
|
||||||
@doc false
|
@doc false
|
||||||
def changeset(channel, attrs) do
|
def changeset(channel, attrs) do
|
||||||
tag_id =
|
tag_id =
|
||||||
if attrs["artist_tag"] do
|
case Repo.get_by(Tag, name: attrs["artist_tag"] || "") do
|
||||||
Repo.get_by(Tag, name: attrs["artist_tag"]).id
|
%{id: id} -> id
|
||||||
else
|
_ -> nil
|
||||||
nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
channel
|
channel
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
h1 Adding Channel
|
h1 Adding Channel
|
||||||
|
|
||||||
= render PhilomenaWeb.ChannelView, "_form.html", changeset: @changeset, action: Routes.channel_path(@conn, :new), conn: @conn
|
= render PhilomenaWeb.ChannelView, "_form.html", changeset: @changeset, action: Routes.channel_path(@conn, :create), conn: @conn
|
||||||
|
|
Loading…
Reference in a new issue