MultipleObjectsReturned: get() returned more than one DashboardPreferences -- it returned 2!

Issue #61 resolved
Anonymous created an issue

I don't know how does it possible, but it's happend sometime. To fix it for me I added data for user dashboard preferences when we catch DashboardPreferences.DoesNotExist in admin_tools_render_dashboard: {{{


preferences = '{}' prefs = DashboardPreferences() prefs.user = context['request'].user = preferences }}}

it's create an empty record for user before any Ajax save will be posted and prevent situation when 2 parallel ajax request write 2 conflicted rows into database.

Comments (2)

  1. Log in to comment