Skip to content

Commit

Permalink
closes Ghini#151
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrasca committed Oct 20, 2015
1 parent 1be9118 commit 2f68b80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bauble/plugins/plants/species_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,11 @@ def refresh_fullname_label(self, widget=None):
logger.debug("looking for %s %s, found %s"
% (genus, epithet, omonym))
if omonym in [None, self.model]:
## should not warn, so check warning and remove
if self.omonym_box is not None:
self.view.remove_box(self.omonym_box)
self.omonym_box = None
else:
elif self.omonym_box is None: # should warn, but not twice
msg = _("This binomial name is already in your collection"
", as %s.\n\n"
"Are you sure you want to insert it again?") % \
Expand Down
5 changes: 5 additions & 0 deletions bauble/plugins/plants/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,11 @@ def test_cantinsertsametwice(self):
presenter = SpeciesEditorPresenter(model, MockView())
presenter.on_text_entry_changed('sp_species_entry', 'grandiflora')

def test_cantinsertsametwice_warnonce(self):
'while binomial name in view matches database item, warn user'

raise SkipTest('Not Implemented') # presenter uses view internals


from bauble.plugins.plants.species import (
species_markup_func, vernname_markup_func)
Expand Down

0 comments on commit 2f68b80

Please sign in to comment.