Skip to content

Conversation

@epou
Copy link
Member

@epou epou commented Aug 22, 2025

No description provided.

@epou epou requested a review from Copilot August 22, 2025 14:15
@epou epou self-assigned this Aug 22, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes the creation of reports with photos atomic by adding the @transaction.atomic decorator to the create method. This ensures that creating a report and its associated photos either succeeds completely or fails completely, preventing partial state where a report exists without its photos or vice versa.

Key Changes

  • Added @transaction.atomic decorator to the create method of BaseReportWithPhotosSerializer

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

class BaseReportWithPhotosSerializer(BaseReportSerializer):
photos = SimplePhotoSerializer(required=True, many=True)

@transaction.atomic
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transaction module needs to be imported. Add from django.db import transaction at the top of the file to use the @transaction.atomic decorator.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Aug 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.68%. Comparing base (a47f345) to head (04f8561).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #316   +/-   ##
=======================================
  Coverage   50.68%   50.68%           
=======================================
  Files          72       72           
  Lines       10452    10452           
=======================================
  Hits         5298     5298           
  Misses       5154     5154           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@epou epou merged commit ffd02e3 into master Aug 26, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants