equal
deleted
inserted
replaced
64 |
64 |
65 if request.method == "POST": |
65 if request.method == "POST": |
66 if not can_upload: |
66 if not can_upload: |
67 return show_msg(user, "You are not authorised to upload data to this task", task_url, "view the task") |
67 return show_msg(user, "You are not authorised to upload data to this task", task_url, "view the task") |
68 |
68 |
69 pass |
69 form = WorkReportForm(request.POST, request.FILES) |
|
70 |
|
71 if form.is_valid(): |
|
72 r = WorkReport(attachment = form.cleaned_data['remarks'], |
|
73 remarks = form.cleaned_data['remarks'], |
|
74 revision = old_reports.count(), |
|
75 task = task, |
|
76 submitted_by = user, |
|
77 created_at = datetime.now(), |
|
78 ) |
|
79 |
|
80 r.save() |
|
81 return redirect(task_url) |
|
82 |
|
83 else: |
|
84 context.update({"form":form}) |
|
85 return render_to_response('task/report.html', context) |
|
86 |
70 else: |
87 else: |
71 form = WorkReportForm() |
88 form = WorkReportForm() |
72 context.update({"form":form}) |
89 context.update({"form":form}) |
73 return render_to_response('task/report.html', context) |
90 return render_to_response('task/report.html', context) |
74 |
91 |