def perform_suggestion(unit, form, request):
 if (form.cleaned_data[u'target'][0] == u''):
  messages.error(request, _(u'Your suggestion is empty!'))
  return False
 elif (not can_suggest(request.user, unit.translation)):
  messages.error(request, _(u"You don't have privileges to add suggestions!"))
  return False
 recent_changes = Change.objects.content(True).filter(translation=unit.translation).exclude(user=None)
 if (not recent_changes.exists()):
  messages.info(request, _(u'There is currently no active translator for this translation, please consider becoming a translator as your suggestion might otherwise remain unreviewed.'))
 Suggestion.objects.add(unit, join_plural(form.cleaned_data[u'target']), request)
 return True

def perform_suggestion ( unit , form , request ) : if ( form . cleaned_data [ u'target' ] [ 0 ] == u'' ) : messages . error ( request , _ ( u'Your suggestion is empty!' ) ) return False elif ( not can_suggest ( request . user , unit . translation ) ) : messages . error ( request , _ ( u"You don't have privileges to add suggestions!" ) ) return False recent_changes = Change . objects . content ( True ) . filter ( translation = unit . translation ) . exclude ( user = None ) if ( not recent_changes . exists ( ) ) : messages . info ( request , _ ( u'There is currently no active translator for this translation, please consider becoming a translator as your suggestion might otherwise remain unreviewed.' ) ) Suggestion . objects . add ( unit , join_plural ( form . cleaned_data [ u'target' ] ) , request ) return True
handle suggesion saving .