Skip to content

Commit

Permalink
Added missed auto_add argument (#6364)
Browse files Browse the repository at this point in the history
<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

Resolved #4394

<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- [x] I have added a description of my changes into the
[CHANGELOG](https://github.com/opencv/cvat/blob/develop/CHANGELOG.md)
file
- [ ] I have updated the documentation accordingly
- [ ] I have added tests to cover my changes
- [x] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))
- [ ] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.
  • Loading branch information
bsekachev authored and azhavoro committed Jun 29, 2023
1 parent ab020f5 commit 7750d5a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## \[2.4.9] - 2023-06-22
### Fixed
- Error related to calling serverless functions on some image formats (<https://github.com/opencv/cvat/pull/6384>)

## \[2.4.8] - 2023-06-22
### Fixed
- Getting original chunks for items in specific cases (<https://github.com/opencv/cvat/pull/6355>)
Expand Down
28 changes: 28 additions & 0 deletions cvat/apps/engine/migrations/0072_alter_issue_updated_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.1 on 2023-06-23 19:26

from django.db import migrations, models

def forwards_func(apps, schema_editor):
Issue = apps.get_model("engine", "Issue")

issues = Issue.objects.all()
for issue in issues:
issue.updated_date = issue.created_date

Issue.objects.bulk_update(issues, fields=['updated_date'], batch_size=500)

class Migration(migrations.Migration):
dependencies = [
("engine", "0071_annotationguide_asset"),
]

operations = [
migrations.RunPython(
code=forwards_func,
),
migrations.AlterField(
model_name="issue",
name="updated_date",
field=models.DateTimeField(auto_now=True),
),
]
2 changes: 1 addition & 1 deletion cvat/apps/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ class Issue(models.Model):
assignee = models.ForeignKey(User, null=True, blank=True, related_name='+',
on_delete=models.SET_NULL)
created_date = models.DateTimeField(auto_now_add=True)
updated_date = models.DateTimeField(null=True, blank=True)
updated_date = models.DateTimeField(auto_now=True)
resolved = models.BooleanField(default=False)

def get_project_id(self):
Expand Down
10 changes: 5 additions & 5 deletions tests/python/shared/assets/cvat_db/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -9660,7 +9660,7 @@
],
"assignee": null,
"created_date": "2022-03-16T11:04:39.444Z",
"updated_date": null,
"updated_date": "2022-03-16T11:04:39.444Z",
"resolved": true
}
},
Expand All @@ -9676,7 +9676,7 @@
],
"assignee": null,
"created_date": "2022-03-16T11:07:22.170Z",
"updated_date": null,
"updated_date": "2022-03-16T11:07:22.170Z",
"resolved": false
}
},
Expand All @@ -9692,7 +9692,7 @@
],
"assignee": null,
"created_date": "2022-03-16T11:08:18.367Z",
"updated_date": null,
"updated_date": "2022-03-16T11:08:18.367Z",
"resolved": false
}
},
Expand All @@ -9710,7 +9710,7 @@
"user1"
],
"created_date": "2022-03-16T12:40:00.764Z",
"updated_date": null,
"updated_date": "2022-03-16T12:40:00.764Z",
"resolved": false
}
},
Expand All @@ -9726,7 +9726,7 @@
],
"assignee": null,
"created_date": "2022-03-16T12:49:29.369Z",
"updated_date": null,
"updated_date": "2022-03-16T12:49:29.369Z",
"resolved": false
}
},
Expand Down
10 changes: 5 additions & 5 deletions tests/python/shared/assets/issues.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
362.6243902439037
],
"resolved": false,
"updated_date": null
"updated_date": "2022-03-16T12:49:29.369000Z"
},
{
"assignee": {
Expand Down Expand Up @@ -59,7 +59,7 @@
561.4921875
],
"resolved": false,
"updated_date": null
"updated_date": "2022-03-16T12:40:00.764000Z"
},
{
"assignee": null,
Expand All @@ -85,7 +85,7 @@
703.3505859375
],
"resolved": false,
"updated_date": null
"updated_date": "2022-03-16T11:08:18.367000Z"
},
{
"assignee": null,
Expand All @@ -111,7 +111,7 @@
841.5859375
],
"resolved": false,
"updated_date": null
"updated_date": "2022-03-16T11:07:22.170000Z"
},
{
"assignee": null,
Expand Down Expand Up @@ -147,7 +147,7 @@
319.63386727689067
],
"resolved": true,
"updated_date": null
"updated_date": "2022-03-16T11:04:39.444000Z"
}
]
}

0 comments on commit 7750d5a

Please sign in to comment.