'Set Resolution if selected'

def save(self, *args, **kwargs):

    instance = super(TicketRecordForm, self).save(*args, **kwargs)
    ticket = self.ticket
    if (('resolution' in self.cleaned_data) and self.cleaned_data['resolution']):
        ticket.resolution = self.cleaned_data['body']
        ticket.save()
    if (('notify' in self.cleaned_data) and self.cleaned_data['notify'] and ticket.caller):
        toaddr = ticket.caller.get_email()
        if (ticket.message or toaddr):
            reply = Message()
            reply.author = instance.sender
            reply.body = instance.body
            reply.auto_notify = False
            if ticket.message:
                reply.stream = ticket.message.stream
                reply.reply_to = ticket.message
            else:
                reply.stream = (ticket.queue.message_stream if ticket.queue else None)
                reply.title = ('[#%s]    %s' % (ticket.reference, ticket.name))
            reply.save()
            if (not ticket.message):
                ticket.message = reply
            reply.recipients.add(ticket.caller)
            email = EmailMessage(reply)
            email.send_email()
    return instance
