benwbrum / fromthepage

FromThePage is a wiki-like application for crowdsourcing transcription of handwritten documents.
http://fromthepage.com
GNU Affero General Public License v3.0
169 stars 49 forks source link

owner profile page causes 500 error #4161

Open saracarl opened 2 months ago

saracarl commented 2 months ago

Going to: https://fromthepage.com/slqtest

Results in a 500 error:

I, [2024-06-17T19:19:33.686193 #3131344]  INFO -- :   Rendered user/profile.html.slim within layouts/application (Duration: 20.4ms | 
Allocations: 13275)
I, [2024-06-17T19:19:33.686651 #3131344]  INFO -- :   Rendered layout layouts/application.html.slim (Duration: 21.1ms | Allocations: 
13982)
I, [2024-06-17T19:19:33.687663 #3131344]  INFO -- : Completed 500  in 46ms (ActiveRecord: 11.3ms | Allocations: 25271)
F, [2024-06-17T19:19:33.696031 #3131344] FATAL -- :   
ActionView::Template::Error (undefined method `show_to?' for nil:NilClass):
    31:   -@deeds.each do |d|
    32:     tr
    33:       td.w100.toleft
    34:         -if d.work.nil? || d.work.access_object(current_user)
    35:           =render(:partial => 'deed/deed.html', :locals => { :deed => d, :long_view => true })
    36:         -else
    37:           =raw(strip_tags(render(:partial => 'deed/deed.html', :locals => { :deed => d, :long_view => true })))

app/models/work.rb:149:in `access_object'
app/views/user/_user_profile.html.slim:34
app/views/user/_user_profile.html.slim:31
app/views/user/profile.html.slim:6
app/controllers/application_controller.rb:64:in `switch_locale'
saracarl commented 2 months ago

Is this a regression? I guess we need to identify the cause -- my theory is the space in their username? In which case it would be.