Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Commit a7df8ff

Browse files
committed
Fix indentation and re-arrange complicated conditional.
1 parent c502379 commit a7df8ff

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lib/modules/dosomething/dosomething_northstar/dosomething_northstar.module

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)