Compare commits
3 Commits
master
...
69ba0245bb
| Author | SHA1 | Date | |
|---|---|---|---|
| 69ba0245bb | |||
| 597aa1f2e0 | |||
| fbc4c479e8 |
@@ -79,7 +79,7 @@ defmodule ConfientWeb.AssignmentController do
|
|||||||
conn |> put_flash(:error, "Devoir inexistant") |> redirect(to: "/")
|
conn |> put_flash(:error, "Devoir inexistant") |> redirect(to: "/")
|
||||||
|
|
||||||
assignment ->
|
assignment ->
|
||||||
base = Application.get_env(:confient, :upload_dir)
|
base = Application.get_env(:confiant, :upload_dir)
|
||||||
|
|
||||||
files =
|
files =
|
||||||
Enum.map(assignment.students_works, fn v -> v.path end)
|
Enum.map(assignment.students_works, fn v -> v.path end)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ defmodule ConfientWeb.DepositController do
|
|||||||
{:ok, class} ->
|
{:ok, class} ->
|
||||||
next_assignments = Confient.Works.get_next_assignments(class)
|
next_assignments = Confient.Works.get_next_assignments(class)
|
||||||
|
|
||||||
if length(next_assignments) > 0 && length(class.students) > 0 do
|
if length(next_assignments) > 0 && length(class.students) do
|
||||||
changeset = Confient.Student.Work.changeset(%Confient.Student.Work{}, %{})
|
changeset = Confient.Student.Work.changeset(%Confient.Student.Work{}, %{})
|
||||||
|
|
||||||
student =
|
student =
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ defmodule ConfientWeb.Router do
|
|||||||
|
|
||||||
plug Plug.Static,
|
plug Plug.Static,
|
||||||
at: "/uploads/",
|
at: "/uploads/",
|
||||||
from: Application.get_env(:confient, :upload_dir, "/srv/confient/uploads")
|
from: Application.get_env(:confiant, :upload_dir, "/srv/confient/uploads")
|
||||||
end
|
end
|
||||||
|
|
||||||
scope "/", ConfientWeb do
|
scope "/", ConfientWeb do
|
||||||
|
|||||||
@@ -7,10 +7,7 @@ defmodule Confient.Deposit do
|
|||||||
|
|
||||||
def verify_date(due) do
|
def verify_date(due) do
|
||||||
date = DateTime.now!(Application.fetch_env!(:confient, :timezone)) |> DateTime.to_date()
|
date = DateTime.now!(Application.fetch_env!(:confient, :timezone)) |> DateTime.to_date()
|
||||||
|
if Timex.before?(date, due), do: :ok, else: {:error, :date_too_late}
|
||||||
if Timex.before?(date, due) || Timex.equal?(Timex.to_date(date), due),
|
|
||||||
do: :ok,
|
|
||||||
else: {:error, :date_too_late}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_file(file) do
|
def verify_file(file) do
|
||||||
|
|||||||
Reference in New Issue
Block a user