Skip to content

Commit

Permalink
Fixes #1052: column heading bug (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
dolsysmith authored Apr 7, 2021
1 parent 4c0c9a2 commit 6c3ac75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ want to run the search once and then turn off the collection.
See :ref:`guide-incremental-collecting` to decide whether or not to collect
incrementally.

Only one active seed can be used per search collection. If you need to run multiple searches in parallel, create a new collection for each search, each with a single seed.

.. _guide-twitter-sample:

.. _Twitter sample:
Expand Down
8 changes: 5 additions & 3 deletions sfm/ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def get_initial_queryset(self):
for exclusion in exclude_fields:
if exclusion in self.columns:
self.columns.remove(exclusion)
# Need to update this property here, because it's used by the get_context_data() method of BaseDataTableView and is set PRIOR to the call to this method
self._columns = self.columns

return Seed.objects.filter(collection=self.kwargs['pk'], is_active=self.status == 'active').order_by('token',
'uid')
Expand Down Expand Up @@ -283,19 +285,19 @@ def get_context_data(self, **kwargs):
seed_error_message = None
# No active seeds.
if self.object.required_seed_count() == 0 and self.object.active_seed_count() != 0:
seed_error_message = "All seeds must be deactivated before harvesting can be turned on."
seed_error_message = "All seeds must be deleted before harvesting can be turned on."
# Specific number of active seeds.
elif self.object.required_seed_count() == 1:
if self.object.active_seed_count() == 0:
seed_warning_message = "1 active seed must be added before harvesting can be turned on."
elif self.object.active_seed_count() > 1:
seed_error_message = "Deactivate all seeds except 1 before harvesting can be turned on."
seed_error_message = "Delete all seeds except 1 before harvesting can be turned on."
elif self.object.required_seed_count() is not None and self.object.required_seed_count() > 1:
if self.object.active_seed_count() < self.object.required_seed_count():
seed_warning_message = "{} active seeds must be added before harvesting can be turned on.".format(
self.object.required_seed_count())
elif self.object.active_seed_count > self.object.required_seed_count():
seed_error_message = "Deactivate all seeds except {} before harvesting can be turned on.".format(
seed_error_message = "Delete all seeds except {} before harvesting can be turned on.".format(
self.object.required_seed_count())
# At least one active seeds
elif self.object.required_seed_count() is None and self.object.active_seed_count() == 0:
Expand Down

0 comments on commit 6c3ac75

Please sign in to comment.