-
Notifications
You must be signed in to change notification settings - Fork 54
Fix #1518, check also unavailable views/tasks for projects sync #1524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.5.0/release
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,11 +41,11 @@ def handle(self, *args, **options): | |
| self.show_project_tasks_and_views() | ||
|
|
||
| def sync_all_tasks_or_views_to_projects(self, model): | ||
| queryset = model.objects.filter(available=True) | ||
| queryset = model.objects.all() | ||
| model_name = model._meta.verbose_name_plural | ||
| qs_count = queryset.count() | ||
|
|
||
| self.stdout.write(self.style.SUCCESS(f'Starting sync for {qs_count} available {model_name}...')) | ||
| self.stdout.write(self.style.SUCCESS(f'Starting sync for {qs_count} {model_name}...')) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| for instance in queryset: | ||
| self.stdout.write(f'- Syncing: {instance}') | ||
| sync_task_or_view_to_projects(instance) | ||
|
|
@@ -62,15 +62,13 @@ def show_project_tasks_and_views(self): | |
| self.stdout.write(f'Project "{project.title}" [id={project.id}]:') | ||
| self.stdout.write(f'- Catalog: {project.catalog.uri}') | ||
|
|
||
| if task_uris: | ||
| self.stdout.write("- Tasks:") | ||
| for task_uri in task_uris: | ||
| self.stdout.write(f" - {task_uri}") | ||
| self.stdout.write("- Tasks:") | ||
| for task_uri in task_uris: | ||
| self.stdout.write(f" - {task_uri}") | ||
|
|
||
| if view_uris: | ||
| self.stdout.write("- Views:") | ||
| for view_uri in view_uris: | ||
| self.stdout.write(f" - {view_uri}") | ||
| self.stdout.write("- Views:") | ||
| for view_uri in view_uris: | ||
| self.stdout.write(f" - {view_uri}") | ||
|
|
||
| self.stdout.write() # add an empty line for spacing between projects | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line would leave out the unavailable tasks/views from the sync, so that they will not be removed from the projects by this command.
That would need to be fixed with the
queryset = model.objects.all()so that the sync functions as expected.