Skip to content

Commit

Permalink
Fixes MarkUsProject#426. Changes all uploads to post instead of get.
Browse files Browse the repository at this point in the history
  • Loading branch information
akrassikov committed Nov 28, 2011
1 parent 6322cf0 commit 532fd31
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/controllers/annotation_categories_controller.rb
Expand Up @@ -106,7 +106,7 @@ def csv_upload
annotation_category_number = 0
annotation_line = 0
if !annotation_category_list.nil?
FasterCSV.parse(annotation_category_list) do |row|
FasterCSV.parse(annotation_category_list.read) do |row|
next if FasterCSV.generate_line(row).strip.empty?
annotation_line += 1
result = AnnotationCategory.add_by_row(row, @assignment)
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Expand Up @@ -144,7 +144,7 @@ def self.upload_user_list(user_class, user_list)
# read each line of the file and update classlist
User.transaction do
processed_users = []
FasterCSV.parse(user_list, :skip_blanks => true, :row_sep => :auto) do |row|
FasterCSV.parse(user_list.read, :skip_blanks => true, :row_sep => :auto) do |row|
# don't know how to fetch line so we concat given array
next if FasterCSV.generate_line(row).strip.empty?
if processed_users.include?(row[0])
Expand Down
25 changes: 14 additions & 11 deletions config/routes.rb
Expand Up @@ -48,16 +48,16 @@

collection do
get 'update_positions'
get 'csv_upload'
get 'yml_upload'
post 'csv_upload'
post 'yml_upload'
get 'download_csv'
get 'download_yml'
end
end

resources :flexible_criteria do
collection do
get 'upload'
post 'upload'
get 'update_positions'
get 'move_criterion'
get 'download'
Expand All @@ -70,7 +70,7 @@
post 'update' # because of collection
post 'update_positions'
get 'update_positions'
get 'upload'
post 'upload'
get 'download'
get 'move_criterion'
end
Expand All @@ -83,7 +83,7 @@
get 'add_group'
get 'use_another_assignment_groups'
get 'manage'
get 'csv_upload'
post 'csv_upload'
get 'add_csv_group'
get 'download_grouplist'
get 'create_groups_when_students_work_alone'
Expand Down Expand Up @@ -159,7 +159,7 @@
resources :graders do
collection do
get 'add_grader_to_grouping'
get 'csv_upload_grader_groups_mapping'
post 'csv_upload_grader_groups_mapping'
post 'csv_upload_grader_criteria_mapping'
get 'download_dialog'
get 'download_grouplist'
Expand Down Expand Up @@ -189,11 +189,14 @@

collection do
get 'add_annotation_category'
get 'csv_upload'
get 'add_annotation_text'
post 'csv_upload'
get 'delete_annotation_category'
get 'download'
get 'yml_upload'
post 'yml_upload'
post 'delete_annotation_text'
post 'update_annotation_category'
post 'update_annotation'
end
end
end
Expand All @@ -207,7 +210,7 @@
get 'grades'
get 'g_table_paginate'
get 'csv_download'
get 'csv_upload'
post 'csv_upload'
post 'update_grade'
post 'student_interface'
post 'update_grade_entry_students'
Expand Down Expand Up @@ -244,14 +247,14 @@
post 'populate'
get 'manage'
get 'download_student_list'
get 'upload_student_list'
post 'upload_student_list'
end
end

resources :tas do
collection do
post 'populate'
get 'upload_ta_list'
post 'upload_ta_list'
get 'download_ta_list'
end
end
Expand Down

0 comments on commit 532fd31

Please sign in to comment.