### Summary
In MedCAT Trainer 3.6.1, manually selected meta-annotation tasks are automatically cleared when a project uses a model pack that does not contain MetaCAT models. This prevents users from setting up manual meta-annotation tasks for training MetaCAT models from scratch.
### Environment
- **MedCAT Trainer version:** 3.6.1 (broken), 3.6.0 (working)
- **Deployment:** Docker container
- **Model pack:** Base NER+L model without MetaCAT models
### Steps to Reproduce
1. Spin up a new instance of MedCAT Trainer 3.6.1
2. Upload a model pack that does **not** contain MetaCAT models (e.g. a base NER+L model pack)
3. Upload a dataset and import the CDB to Solr
4. Create a MetaTask (e.g. “Presence”) with MetaTaskValues (e.g. current, hypothetical, negated)
5. In Django admin, edit a `ProjectAnnotateEntities` project and select the “Presence” meta-task in the tasks field
6. Save the project
7. Check the project’s meta_tasks via mctclient or Django admin
### Expected Behaviour
Manually selected meta-tasks persist on the project, allowing users to configure manual meta-annotation workflows when training MetaCAT models from scratch.
### Actual Behaviour
The manually selected meta-tasks are immediately cleared and replaced with an empty list.
So I pushed this through claude and it suggested the following problem:
The signal handler `project_tasks_changed` overwrites the selection with tasks derived from the model pack’s MetaCAT models — which is empty when the model pack has none.
and fix:
```python
def project_tasks_changed(sender, instance, action, **kwargs):
if (action.startswith(‘post’) and isinstance(instance, ProjectAnnotateEntitiesFields) and
instance.model_pack is not None and instance.model_pack.meta_cats.exists()):
instance.tasks.set(\[MetaTask.objects.filter(prediction_model_id=meta_cat.id).first()
for meta_cat in instance.model_pack.meta_cats.all()])
```
but unfortunately this doesn’t seem to actually fix the problem. I am not good enough at python to be able to solve the root cause of this problem unfortunately.
Very happy to help try to give more information to solve this problem, or be pointed in correct direction if I am doing something wrong; fix for me at present it to move back 3.6.0 which does work with meta annotation.