albrechtjan / workload

Survey web application for TU Dresden
survey.zqa.tu-dresden.de
GNU Affero General Public License v3.0
0 stars 0 forks source link

request.user.student vs student , foo = Student.objects.get_or_create(user=request.user) #51

Closed KonstantinSchubert closed 9 years ago

KonstantinSchubert commented 9 years ago

We cannot use request.user.student in case the user logs in for the first time and does not yet have a student object. On the other hand , doing get_or_create every time is annoying. Maybe the middleware or the backend can make sure that the student is created on time? After all, if we log in we need to create the student already.

KonstantinSchubert commented 9 years ago

I can fix this by doing what I suggested here https://github.com/KonstantinSchubert/workload/blob/master/server-side/workload/workloadApp/backends.py#L20