diff --git a/tasks/templates/tasks/taskDetail.djhtml b/tasks/templates/tasks/taskDetail.djhtml index e6235cd..5c4aae4 100644 --- a/tasks/templates/tasks/taskDetail.djhtml +++ b/tasks/templates/tasks/taskDetail.djhtml @@ -30,27 +30,29 @@ {% endif %} -
{{ event.date }} | diff --git a/tasks/views.py b/tasks/views.py index de03d88..8d08729 100644 --- a/tasks/views.py +++ b/tasks/views.py @@ -31,11 +31,14 @@ def taskDetail(request, asset_tag, task_slug): events = task.event_set.all() if request.method == 'POST': - event = Event(task=task) - form = EventForm(request.POST, instance=event) - if form.is_valid(): - form.save() - pass + if request.user.is_authenticated: + event = Event(task=task) + form = EventForm(request.POST, instance=event) + if form.is_valid(): + form.save() + else: + form = EventForm(request.POST) + form.add_error(None, "Not authenticated: please login") else: form = EventForm(initial={ 'date': datetime.now(),