From bd964105b48e2aebfc0d0785b1b0980335314907 Mon Sep 17 00:00:00 2001 From: shibao Date: Wed, 16 Feb 2022 20:52:42 -0500 Subject: [PATCH] don't allow reassigning token --- lib/cannery/invites/invite.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cannery/invites/invite.ex b/lib/cannery/invites/invite.ex index c6e4d0bb..7b606f1f 100644 --- a/lib/cannery/invites/invite.ex +++ b/lib/cannery/invites/invite.ex @@ -50,7 +50,7 @@ defmodule Cannery.Invites.Invite do @spec update_changeset(t() | new_invite(), attrs :: map()) :: Changeset.t(t() | new_invite()) def update_changeset(invite, attrs) do invite - |> cast(attrs, [:name, :token, :uses_left, :disabled_at]) + |> cast(attrs, [:name, :uses_left, :disabled_at]) |> validate_required([:name, :token, :user_id]) |> validate_number(:uses_left, greater_than_or_equal_to: 0) end