MDL-37621 assign: Fix for DB error on update.

This properly handles the case when the teamsubmissiongroupingid is disabled.