Allow empty message field to close a ticket

master
Alice 8 years ago
parent 0fa2d450fd
commit b7e96cf784

@ -35,7 +35,14 @@
<form class="pure-form pure-form-stacked" action="" method="post">
{% csrf_token %}
{{ form }}
<label for="id_message">Message:</label>
<textarea cols="40" id="id_message" name="message" rows="10"></textarea>
{% if staff_reply %}
<label for="id_staff_only">Private:</label>
<input id="id_staff_only" name="staff_only" type="checkbox" />
{% endif %}
<input type="submit" class="pure-button pure-button-primary button-1-2" value="{% trans 'Reply' %}" />
{% if ticket.is_open %}

@ -107,15 +107,11 @@ def view(request, id):
messages = ticket.message_set.filter(staff_only=False)
if request.method != 'POST':
if request.user.is_staff:
form = StaffReplyForm()
else:
form = ReplyForm()
ctx = dict(
staff_reply=request.user.has_perm('tickets.post_private_message'),
ticket=ticket,
ticket_messages=messages,
form=form,
form=ReplyForm(),
title=_("Ticket:") + " " + ticket.subject,
)
ctx.update(common_context(request))
@ -142,6 +138,7 @@ def view(request, id):
if not form.is_valid():
ctx = dict(
staff_reply=request.user.has_perm('tickets.post_private_message'),
ticket=ticket,
ticket_messages=messages,
form=form,

Loading…
Cancel
Save