Closed adieyal closed 10 years ago
I've updated the README to note that there is now a admin UI for adding users manually. If you would like to continue with the CSV route, I've made a few fixes to the CSV import route and the views that should let you continue without problems. Make sure you pull up to commit faf7b25f3a25be2fbae574acfbf798f1c67a6703.
Thanks
I'm having another problem using the admin interface. Adding a twitter account I get the following error:
ActiveRecord::StatementInvalid in Admin::PoliticiansController#save_user
Mysql2::Error: Column 'twitter_id' cannot be null: INSERT INTO `politicians` (`account_type_id`, `avatar_content_type`, `avatar_file_name`, `avatar_file_size`, `avatar_updated_at`, `first_name`, `gender`, `last_name`, `middle_name`, `office_id`, `party_id`, `profile_image_url`, `state`, `status`, `suffix`, `twitter_id`, `user_name`) VALUES (NULL, NULL, NULL, NULL, NULL, NULL, 'U', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, 'helenzille')
Rails.root: /politwoops
Application Trace | Framework Trace | Full Trace
app/controllers/admin/politicians_controller.rb:47:in `save_user'
Request
Parameters:
{"twitter_id"=>"",
"user_name"=>"helenzille",
"first_name"=>"Helen",
"middle_name"=>"",
"last_name"=>"Zille",
"suffix"=>"",
"party_id"=>"1",
"status"=>"1",
"state"=>"",
"account_type_id"=>"1",
"office_id"=>"1",
"id"=>"0"}
Show session dump
Show env dump
Response
Headers:
None
Sorry - I forgot to change the api keys
This error seems to keep on recurring but it seems sporadically
What's happening is that your browser is failing to look up the numeric ID for the twitter user name you've specified. In commit 26a44edaaad9b027ec97ddb1cab8ae8f7a99da94 I added an explicit error to make this more clear.
I don't have enough info to why the twitter ID could not be found. There's likely an error logged to your browser's developer console.
Thanks
Just checked my developer's console and there are no errors logged.
Adi
On 10 March 2014 19:41, dvogel notifications@github.com wrote:
What's happening is that your browser is failing to look up the numeric ID for the twitter user name you've specified. In commit 26a44edhttps://github.com/sunlightlabs/politwoops/commit/26a44edaaad9b027ec97ddb1cab8ae8f7a99da94I added an explicit error to make this more clear.
I don't have enough info to why the twitter ID could not be found. There's likely an error logged to your browser's developer console.
Reply to this email directly or view it on GitHubhttps://github.com/sunlightlabs/politwoops/issues/15#issuecomment-37211275 .
Adi Eyal Data Specialist phone: +27 78 014 2469 skype: adieyalcas linkedin: http://za.linkedin.com/pub/dir/Adi/Eyal
Do you see a network request to twitter after the twitter username field loses focus? For example, if you enter drewpvogel into the username and move the cursor to the next field you should see a request to drewpvogel.json.
I think what might be happening is that the ajax call is taking a long time to complete. If I save the new user before the call completes then it doesn't receive the id.
After waiting sufficient time, I saved it again and received this error
Twitter::Error::ClientError in Admin::PoliticiansController#save_user
execution expired
Rails.root: /politwoops
Application Trace | Framework Trace | Full Trace
app/models/politician.rb:124:in `reset_avatar'
app/controllers/admin/politicians_controller.rb:83:in `save_user'
Request
Parameters:
{"twitter_id"=>"21011010",
"user_name"=>"soapsudtycoon",
"first_name"=>"Adi",
"middle_name"=>"",
"last_name"=>"Eyal",
"suffix"=>"",
"party_id"=>"1",
"status"=>"1",
"state"=>"",
"account_type_id"=>"0",
"office_id"=>"0",
"id"=>"0"}
Show session dump
Show env dump
Response
Headers:
None
On 10 March 2014 23:43, dvogel notifications@github.com wrote:
Do you see a network request to twitter after the twitter username field loses focus? For example, if you enter drewpvogel into the username and move the cursor to the next field you should see a request to drewpvogel.json.
Reply to this email directly or view it on GitHub.
Adi Eyal Data Specialist phone: +27 78 014 2469 skype: adieyalcas linkedin: http://za.linkedin.com/pub/dir/Adi/Eyal
I've added a UI change to the admin that should avoid the first failure. As of commit 3babf31fb18f20eb0a96c2ecec6814eb8f1181e4, the user form's save button will be disabled until the twitter ID is retrieved.
The execution expired
error seems related to your deployment. Either the reset_avatar method timed out while contacting the Twitter API or your web server decided it was taking too long and killed it. Have you set up your twitter API key fields in config/config.yml
?
The execution expired error seems related to your deployment. Either the reset_avatar method timed out while contacting the Twitter API or your web server decided it was taking too long and killed it. Have you set up your twitter API key fields in config/config.yml?
I have set the twitter keys but I'll check again.
Adi
Reply to this email directly or view it on GitHubhttps://github.com/sunlightlabs/politwoops/issues/15#issuecomment-37332573 .
Adi Eyal Data Specialist phone: +27 78 014 2469 skype: adieyalcas linkedin: http://za.linkedin.com/pub/dir/Adi/Eyal
I am having problems setting up Politwoops. I can't populate the database with twitter accounts. After changing my consumer and auth keys I tried to populate using the example csv file. No dice. Since that file has a different format to that suggested in the README, I created my own custom file, same problem.
Below is my output
I see errors when I populate the database with the CSV file. See the output here:
Now with my custom file
If I now run the website, I see a few populated twitter accounts but clicking on http://172.17.0.3:3000/user/toddakin/ for instance gives me the following error:
If it is useful, here is a full trace
Any help would be appreciated