#NEWLINE# def save( self ) : #NEWLINE# #INDENT# action = self . cleaned_data [ 'action' ] #NEWLINE# comment = self . cleaned_data . get ( 'comment' ) #NEWLINE# reject_reason = self . cleaned_data . get ( 'reject_reason' ) #NEWLINE# theme = self . cleaned_data [ 'theme' ] #NEWLINE# is_rereview = ( theme . rereviewqueuetheme_set . exists ( ) and ( theme . addon . status not in ( amo . STATUS_PENDING , amo . STATUS_REVIEW_PENDING ) ) ) #NEWLINE# theme_lock = ThemeLock . objects . get ( theme = self . cleaned_data [ 'theme' ] ) #NEWLINE# mail_and_log = True #NEWLINE# if ( action == rvw . ACTION_APPROVE ) : #NEWLINE# #INDENT# if is_rereview : #NEWLINE# #INDENT# approve_rereview ( theme ) #NEWLINE# #UNINDENT# theme . addon . update ( status = amo . STATUS_PUBLIC ) #NEWLINE# theme . approve = datetime . datetime . now ( ) #NEWLINE# theme . save ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( action in ( rvw . ACTION_REJECT , rvw . ACTION_DUPLICATE ) ) : #NEWLINE# #INDENT# if is_rereview : #NEWLINE# #INDENT# reject_rereview ( theme ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# theme . addon . update ( status = amo . STATUS_REJECTED ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( action == rvw . ACTION_FLAG ) : #NEWLINE# #INDENT# if is_rereview : #NEWLINE# #INDENT# mail_and_log = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# theme . addon . update ( status = amo . STATUS_REVIEW_PENDING ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( action == rvw . ACTION_MOREINFO ) : #NEWLINE# #INDENT# if ( not is_rereview ) : #NEWLINE# #INDENT# theme . addon . update ( status = amo . STATUS_REVIEW_PENDING ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if mail_and_log : #NEWLINE# #INDENT# send_mail ( self . cleaned_data , theme_lock ) #NEWLINE# amo . log ( amo . LOG . THEME_REVIEW , theme . addon , details = { #NEWLINE# #INDENT# 'theme' : theme . addon . name . localized_string , #NEWLINE# 'action' : action , #NEWLINE# 'reject_reason' : reject_reason , #NEWLINE# 'comment' : comment , #NEWLINE# #UNINDENT# } , user = theme_lock . reviewer ) #NEWLINE# log . info ( ( '%sTheme %s (%s) - %s' % ( ( '[Rereview] ' if is_rereview else '' ) , theme . addon . name , theme . id , action ) ) ) #NEWLINE# #UNINDENT# score = 0 #NEWLINE# if ( action in ( rvw . ACTION_REJECT , rvw . ACTION_DUPLICATE , rvw . ACTION_APPROVE ) ) : #NEWLINE# #INDENT# score = ReviewerScore . award_points ( theme_lock . reviewer , theme . addon , theme . addon . status ) #NEWLINE# #UNINDENT# theme_lock . delete ( ) #NEWLINE# return score