ytsm icon indicating copy to clipboard operation
ytsm copied to clipboard

Settings page throws exception

Open gerroon opened this issue 7 years ago • 7 comments

MultipleObjectsReturned at /settings/

get() returned more than one UserPreferenceModel -- it returned 2!

Request Method: GET Request URL: http://192.168.1.100:8001/settings/ Django Version: 2.1.4 Exception Type: MultipleObjectsReturned Exception Value:

get() returned more than one UserPreferenceModel -- it returned 2!

Exception Location: /media/VIDEO/ytsm/.env/lib/python3.7/site-packages/django/db/models/query.py in get, line 403 Python Executable: /media/VIDEO/ytsm/.env/bin/python3 Python Version: 3.7.2 Python Path:

['/media/VIDEO/ytsm/app', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/media/VIDEO/ytsm/.env/lib/python3.7/site-packages']

Server time: Mon, 31 Dec 2018 02:59:50 +0000

gerroon avatar Dec 31 '18 03:12 gerroon

That's odd, it seems that the django_dynamic_preferences module messed up somehow and added 2 entries for the same preference for the same user. To fix this issue, you should manually edit the database using an SQLite editor tool. If it happens again, it might be a bug in django_dynamic_preferences, and we should discuss with them.

chibicitiberiu avatar Dec 31 '18 10:12 chibicitiberiu

thanks I will try it

gerroon avatar Dec 31 '18 16:12 gerroon

So what do I do witht he sql database editor to remove this error? I do not know what I am going to edit. I cant seem to save settings

gerroon avatar Dec 31 '18 19:12 gerroon

Sqlite editor, not just sql. Basically, look in the 'dynamic user preferences' table for a duplicated entry. If you have multiple users set up, you should have entries for each preference for each user.

I can help you spot it, if you post a screen shot or a table dump.

On Mon, Dec 31, 2018, 21:48 gerroon <[email protected] wrote:

So what do I do witht he sql database editor to remove this error? I do not know what I am going to edit. I cant seem to save settings

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chibicitiberiu/ytsm/issues/55#issuecomment-450684703, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8dkQMF3L9ocYE44skriRATuLpXq-uAks5u-mocgaJpZM4ZlK1o .

chibicitiberiu avatar Dec 31 '18 19:12 chibicitiberiu

See this

Not sure how I delete those, I do not see a delete button anywhere

image

gerroon avatar Dec 31 '18 23:12 gerroon

mark_deleted_as_watched and download_autogenerated_subtitles seem to be the problem. Make a backup of the database just in case, and delete the duplicates. See if you can access settings after that.

chibicitiberiu avatar Dec 31 '18 23:12 chibicitiberiu

ok initial test works after the edit

gerroon avatar Dec 31 '18 23:12 gerroon