@@ -89,24 +89,28 @@ function dosomething_northstar_register_user($form_state) {
8989 global $user;
9090 // Build a user that Northstar expects.
9191 $ns_user = dosomething_northstar_build_ns_user($user, $form_state);
92+
9293 $client = _dosomething_northstar_build_http_client();
9394 $response = drupal_http_request($client['base_url'] . '/users', array(
9495 'headers' => $client['headers'],
9596 'method' => 'POST',
9697 'data' => json_encode($ns_user),
97- ));
98- if ($response->code === '200' && module_exists('stathat')) {
99- stathat_send_ez_count('drupal - Northstar - user migrated - count', 1);
100- }
101- elseif ($response->code !== '200') {
102- watchdog('dosomething_northstar', 'User not migrated : ' . $response->code, NULL, WATCHDOG_ERROR);
103- }
98+ ));
10499
105100 // Save the newly registered user's ID to their local profile field.
106101 dosomething_northstar_save_id_field($user, json_decode($response->data));
107102
108103 // Add to request log if enabled.
109104 dosomething_northstar_log_request('register_user', $user, $ns_user, $response);
105+
106+ if ($response->code !== '200') {
107+ watchdog('dosomething_northstar', 'User not migrated : ' . $response->code, NULL, WATCHDOG_ERROR);
108+ return;
109+ }
110+
111+ if (module_exists('stathat')) {
112+ stathat_send_ez_count('drupal - Northstar - user migrated - count', 1);
113+ }
110114}
111115
112116/**
0 commit comments