File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -225,9 +225,13 @@ def unit_dir(unit, create = true)
225225 dir_for_unit_code_and_id ( unit . code , unit . id , create )
226226 end
227227
228- def unit_portfolio_dir ( unit , create = true )
228+ def root_portfolio_dir
229229 file_server = Doubtfire ::Application . config . student_work_dir
230- dst = "#{ file_server } /portfolio/" # trust the server config and passed in type for paths
230+ "#{ file_server } /portfolio/" # trust the server config and passed in type for paths
231+ end
232+
233+ def unit_portfolio_dir ( unit , create = true )
234+ dst = root_portfolio_dir
231235
232236 dst << sanitized_path ( "#{ unit . code } -#{ unit . id } " ) << '/'
233237
@@ -674,6 +678,7 @@ def line_wrap(path, width: 160)
674678 module_function :student_work_root
675679 module_function :dir_for_unit_code_and_id
676680 module_function :unit_dir
681+ module_function :root_portfolio_dir
677682 module_function :unit_portfolio_dir
678683 module_function :student_portfolio_dir
679684 module_function :student_portfolio_path
Original file line number Diff line number Diff line change @@ -63,5 +63,8 @@ namespace :maintenance do
6363 unit . archive_submissions ( $stdout)
6464 unit . update ( archived : true )
6565 end
66+
67+ puts "Removing old portfolio PDFs"
68+ `find #{ FileHelper . root_portfolio_dir } -name "*pdf.old" -exec rm {} \; `
6669 end
6770end
You can’t perform that action at this time.
0 commit comments