fix attendance model

see #526