### Summary
This pull request improves the `model_update` function by adding proper handling for Django `ValidationError`.
It now converts it into DRF's `ValidationError` to ensure consistent API responses (HTTP 400 instead of 500).
### Changes
- Added `try/except` block around `instance.full_clean()` and `instance.save()`.
- Converted `django.core.exceptions.ValidationError` → `rest_framework.exceptions.ValidationError`.
- Ensured clean, consistent error handling across all model update operations.
### Why
Previously, unhandled validation errors resulted in server errors (500).
This update ensures that all validation issues are returned properly as JSON API responses.
### Testing
- Manually tested with invalid model fields.
- Confirmed correct 400 responses in API.
Summary
This pull request improves the model_update function by adding proper handling for Django ValidationError. It now converts it into DRF's ValidationError to ensure consistent API responses (HTTP 400 instead of 500).
Changes
Why
Previously, unhandled validation errors resulted in server errors (500). This update ensures that all validation issues are returned properly as JSON API responses.
Testing