def update_thread(request, thread_id, update_data):
 (cc_thread, context) = _get_thread_and_context(request, thread_id, retrieve_kwargs={'with_responses': True})
 _check_editable_fields(cc_thread, update_data, context)
 serializer = ThreadSerializer(cc_thread, data=update_data, partial=True, context=context)
 actions_form = ThreadActionsForm(update_data)
 if (not (serializer.is_valid() and actions_form.is_valid())):
  raise ValidationError(dict((serializer.errors.items() + actions_form.errors.items())))
 if (set(update_data) - set(actions_form.fields)):
  serializer.save()
  thread_edited.send(sender=None, user=request.user, post=cc_thread)
 api_thread = serializer.data
 _do_extra_actions(api_thread, cc_thread, update_data.keys(), actions_form, context, request)
 api_thread['read'] = True
 api_thread['unread_comment_count'] = 0
 return api_thread

def update_thread ( request , thread_id , update_data ) : ( cc_thread , context ) = _get_thread_and_context ( request , thread_id , retrieve_kwargs = { 'with_responses' : True } ) _check_editable_fields ( cc_thread , update_data , context ) serializer = ThreadSerializer ( cc_thread , data = update_data , partial = True , context = context ) actions_form = ThreadActionsForm ( update_data ) if ( not ( serializer . is_valid ( ) and actions_form . is_valid ( ) ) ) : raise ValidationError ( dict ( ( serializer . errors . items ( ) + actions_form . errors . items ( ) ) ) ) if ( set ( update_data ) - set ( actions_form . fields ) ) : serializer . save ( ) thread_edited . send ( sender = None , user = request . user , post = cc_thread ) api_thread = serializer . data _do_extra_actions ( api_thread , cc_thread , update_data . keys ( ) , actions_form , context , request ) api_thread [ 'read' ] = True api_thread [ 'unread_comment_count' ] = 0 return api_thread
update a thread .