Skip to content

Commit

Permalink
Group fix, add on duplicate plugin event
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed May 28, 2024
1 parent 4aed7d5 commit 8feb820
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ def duplicate(self, set_new_name=True):
logger.warning("Task {} doesn't have folder, will skip copying".format(self))

self.project.owner.profile.clear_used_quota_cache()

from app.plugins import signals as plugin_signals
plugin_signals.task_duplicated.send_robust(sender=self.__class__, task_id=task.id)

return task
except Exception as e:
logger.warning("Cannot duplicate task: {}".format(str(e)))
Expand Down
1 change: 1 addition & 0 deletions app/plugins/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
task_removed = django.dispatch.Signal(providing_args=["task_id"])
task_failed = django.dispatch.Signal(providing_args=["task_id"])
task_resizing_images = django.dispatch.Signal(providing_args=["task_id"])
task_duplicated = django.dispatch.Signal(providing_args=["task_id"])

processing_node_removed = django.dispatch.Signal(providing_args=["processing_node_id"])
2 changes: 1 addition & 1 deletion app/static/app/js/components/LayersControlAnnotations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AnnotationLayer extends React.Component{
layer._map.setView(layer._latlng, 22);
}

if (layer.getPopup()) layer.openPopup();
// if (layer.getPopup()) layer.openPopup();
}

handleDelete = () => {
Expand Down
2 changes: 1 addition & 1 deletion app/static/app/js/components/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ _('Example:'),
name: name || "",
icon: "fa fa-sticky-note fa-fw"
};
if (this.props.tiles.length > 1 && opts.task){
if (this.props.tiles.length > 1 && task){
meta.group = {id: task.id, name: task.name};
}
layer[Symbol.for("meta")] = meta;
Expand Down

0 comments on commit 8feb820

Please sign in to comment.