2
It seems likely that you have defined a __unicode__
method on StudentUsername that is returning either a User or a Student object – that is, self.user
or self.student
– rather than actual unicode. So when Django tries to slice it, it gets this error.
Ensure that your unicode method actually returns unicode text.
Source:stackexchange.com