@must_have_permission(ADMIN)
@must_be_branched_from_node
def submit_draft_for_review(auth, node, draft, *args, **kwargs):
 data = request.get_json()
 meta = {}
 registration_choice = data.get('registrationChoice', 'immediate')
 validate_registration_choice(registration_choice)
 if (registration_choice == 'embargo'):
  end_date_string = data['embargoEndDate']
  validate_embargo_end_date(end_date_string, node)
  meta['embargo_end_date'] = end_date_string
 meta['registration_choice'] = registration_choice
 draft.submit_for_review(initiated_by=auth.user, meta=meta, save=True)
 if (prereg_utils.get_prereg_schema() == draft.registration_schema):
  node.add_log(action=NodeLog.PREREG_REGISTRATION_INITIATED, params={'node': node._primary_key}, auth=auth, save=False)
  node.save()
 push_status_message(language.AFTER_SUBMIT_FOR_REVIEW, kind='info', trust=False)
 return ({'status': 'initiated', 'urls': {'registrations': node.web_url_for('node_registrations')}}, http.ACCEPTED)

@ must_have_permission ( ADMIN ) @ must_be_branched_from_node def submit_draft_for_review ( auth , node , draft , * args , ** kwargs ) : data = request . get_json ( ) meta = { } registration_choice = data . get ( 'registrationChoice' , 'immediate' ) validate_registration_choice ( registration_choice ) if ( registration_choice == 'embargo' ) : end_date_string = data [ 'embargoEndDate' ] validate_embargo_end_date ( end_date_string , node ) meta [ 'embargo_end_date' ] = end_date_string meta [ 'registration_choice' ] = registration_choice draft . submit_for_review ( initiated_by = auth . user , meta = meta , save = True ) if ( prereg_utils . get_prereg_schema ( ) == draft . registration_schema ) : node . add_log ( action = NodeLog . PREREG_REGISTRATION_INITIATED , params = { 'node' : node . _primary_key } , auth = auth , save = False ) node . save ( ) push_status_message ( language . AFTER_SUBMIT_FOR_REVIEW , kind = 'info' , trust = False ) return ( { 'status' : 'initiated' , 'urls' : { 'registrations' : node . web_url_for ( 'node_registrations' ) } } , http . ACCEPTED )
submit for approvals and/or notifications :return: serialized registration :rtype: dict :raises: httperror if embargo end date is invalid .