Ok so get this.
I have an object "DiscountCode", with a CharField "code".
I have a specific discount code in my SQLite3 database.
The error is that when I write DiscountCode.objects.get(code=thecode), I get a DoesNotExist error.
And yet, it exists.
If I replace the get(code=thecode) with get(code__startswith=thecode), it succeeds.
if I run discount_code.code == thecode, I get True.
They are THE SAME.
I looked into my database.
The code is correctly formatted when I look at it in text mode or binary mode. No weird special characters or invisible whitespaces.
No other discountcode is affected. I can find all the other ones.
I have NO IDEA how to go forward from here.
If you have an idea, I am all ears.