#NEWLINE# @ has_request_variables #NEWLINE# def submit_feedback( request , deployment , message = REQ ( validator = check_dict ( [ ] ) ) ) : #NEWLINE# #INDENT# domainish = message [ 'sender_domain' ] #NEWLINE# if ( get_realm ( 'zulip.com' ) not in deployment . realms . all ( ) ) : #NEWLINE# #INDENT# domainish += ( ' via ' + deployment . name ) #NEWLINE# #UNINDENT# subject = ( '%s' % ( message [ 'sender_email' ] , ) ) #NEWLINE# if ( len ( subject ) > 60 ) : #NEWLINE# #INDENT# subject = ( subject [ : 57 ] . rstrip ( ) + '...' ) #NEWLINE# #UNINDENT# content = '' #NEWLINE# sender_email = subject [ 'sender_email' ] #NEWLINE# need_ticket = has_enough_time_expired_since_last_message ( sender_email , 180 ) #NEWLINE# if need_ticket : #NEWLINE# #INDENT# ticket_number = get_ticket_number ( ) #NEWLINE# content += '\n~~~' #NEWLINE# content += ( '\nticket Z%03d (@support please ack)' % ( ticket_number , ) ) #NEWLINE# content += ( '\nsender: %s' % ( message [ 'sender_full_name' ] , ) ) #NEWLINE# content += ( '\nemail: %s' % ( sender_email , ) ) #NEWLINE# if ( 'sender_domain' in message ) : #NEWLINE# #INDENT# content += ( '\nrealm: %s' % ( message [ 'sender_domain' ] , ) ) #NEWLINE# #UNINDENT# content += '\n~~~' #NEWLINE# content += '\n\n' #NEWLINE# #UNINDENT# content += message [ 'content' ] #NEWLINE# internal_send_message ( 'feedback@zulip.com' , 'stream' , 'support' , subject , content ) #NEWLINE# return HttpResponse ( message [ 'sender_email' ] )