OSDN Git Service

t#31024:fix publishing picture
authoryasushiito <yas@pen-chan.jp>
Sun, 24 Mar 2013 07:52:04 +0000 (16:52 +0900)
committeryasushiito <yas@pen-chan.jp>
Sun, 24 Mar 2013 07:52:04 +0000 (16:52 +0900)
app/views/resource_pictures/new.html.erb
script/uploader.rb

index 0cc7e9f..bab3390 100644 (file)
@@ -1,2 +1,3 @@
-<h1><%= t '.title' -%></h1>
+<h1><%= t 'resource_pictures.new.title' -%></h1>
+<% @page_title = t('resource_pictures.new.title') %>
 <%= render 'resource_pictures/form' %>
index 99f0a3e..f1d143c 100644 (file)
@@ -115,7 +115,9 @@ class Uploader
       )\r
       rp = JSON.parse r\r
     rescue\r
-      puts ' failed: ' + r.to_s\r
+      puts ' failed: ' + u.to_s\r
+      puts param\r
+      puts r.to_s\r
     end\r
     rp\r
   end\r
@@ -157,6 +159,10 @@ class Uploader
       next unless oid\r
       puts 'success: ' + oid.to_s\r
       ls = @licenses[lsname]\r
+      unless ls\r
+        puts 'not detect licenses: ' + lsname.to_s\r
+        next\r
+      end\r
       lsid = ls['id']\r
       lgid = ls['license_group_id'].to_i\r
       lg = @license_groups[lgid]\r