SUSE / Portus

Authorization service and frontend for Docker registry (v2)
http://port.us.org/
Apache License 2.0
3k stars 471 forks source link

Regression: Error when redering activity stream on admin dashboard after user has been deleted #2219

Closed jeanlucmongrain closed 5 years ago

jeanlucmongrain commented 5 years ago

Description

Same as #1106

ActionView::Template::Error (undefined method `display_username' for nil:NilClass):
    10:           - if activity.owner == activity.recipient
    11:             = "#{activity_owner(activity)} removed itself "
    12:           - else
    13:             = "#{activity_owner(activity)} removed user #{activity.recipient.display_username} "
    14:         = "from the "
    15:         = link_to activity_team(activity), activity.trackable
    16:         |  team
  app/views/public_activity/team/_remove_member.html.slim:13:in `_app_views_public_activity_team__remove_member_html_slim___1445167835105684135_44293600'
  app/views/dashboard/partials/_recent_activities.html.slim:23:in `block in _app_views_dashboard_partials__recent_activities_html_slim___1795482159753028365_45055500'
  app/views/dashboard/partials/_recent_activities.html.slim:22:in `_app_views_dashboard_partials__recent_activities_html_slim___1795482159753028365_45055500'
  app/views/dashboard/index.html.slim:6:in `_app_views_dashboard_index_html_slim___2505226875242278169_35241040'
  app/middleware/catch_json_parse_errors.rb:11:in `call'
jeanlucmongrain commented 5 years ago

activity key is team.remove_member and refer to User id 9 and this user had been previously deleted

stale[bot] commented 5 years ago

Thanks for all your contributions! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.