@must_have_permission(ADMIN)
@must_be_branched_from_node
@http_error_if_disk_saving_mode
def register_draft_registration(auth, node, draft, *args, **kwargs):
 data = request.get_json()
 registration_choice = data.get('registrationChoice', 'immediate')
 validate_registration_choice(registration_choice)
 register = draft.register(auth)
 draft.save()
 if (registration_choice == 'embargo'):
  embargo_end_date = parse_date(data['embargoEndDate'], ignoretz=True).replace(tzinfo=pytz.utc)
  try:
   register.embargo_registration(auth.user, embargo_end_date)
  except ValidationValueError as err:
   raise HTTPError(http.BAD_REQUEST, data=dict(message_long=err.message))
 else:
  try:
   register.require_approval(auth.user)
  except NodeStateError as err:
   raise HTTPError(http.BAD_REQUEST, data=dict(message_long=err.message))
 register.save()
 push_status_message(language.AFTER_REGISTER_ARCHIVING, 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 @ http_error_if_disk_saving_mode def register_draft_registration ( auth , node , draft , * args , ** kwargs ) : data = request . get_json ( ) registration_choice = data . get ( 'registrationChoice' , 'immediate' ) validate_registration_choice ( registration_choice ) register = draft . register ( auth ) draft . save ( ) if ( registration_choice == 'embargo' ) : embargo_end_date = parse_date ( data [ 'embargoEndDate' ] , ignoretz = True ) . replace ( tzinfo = pytz . utc ) try : register . embargo_registration ( auth . user , embargo_end_date ) except ValidationValueError as err : raise HTTPError ( http . BAD_REQUEST , data = dict ( message_long = err . message ) ) else : try : register . require_approval ( auth . user ) except NodeStateError as err : raise HTTPError ( http . BAD_REQUEST , data = dict ( message_long = err . message ) ) register . save ( ) push_status_message ( language . AFTER_REGISTER_ARCHIVING , kind = 'info' , trust = False ) return ( { 'status' : 'initiated' , 'urls' : { 'registrations' : node . web_url_for ( 'node_registrations' ) } } , http . ACCEPTED )
initiate a registration from a draft registration :return: success message; url to registrations page :rtype: dict .