Fix drop down showing tags instead of authors in the author mapper

This commit is contained in:
Kovid Goyal 2022-10-31 19:48:15 +05:30
parent 2819ff2c63
commit 4b05986bbd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,7 @@ class RuleEdit(RuleEditBase):
SUBJECT = _('the author, if the author name')
VALUE_ERROR = _('You must provide a value for the author name to match')
REPLACE_TEXT = _('with the name:')
SINGLE_EDIT_FIELD_NAME = 'authors'
@property
def can_use_tag_editor(self):

View File

@ -45,7 +45,7 @@ class SingleTagEdit(EditWithComplete):
self.set_separator(None)
gui = get_gui()
if gui:
self.update_items_cache(gui.current_db.new_api.all_field_names('tags'))
self.update_items_cache(gui.current_db.new_api.all_field_names(getattr(parent, 'SINGLE_EDIT_FIELD_NAME', 'tags')))
class RuleEdit(QWidget):
@ -82,6 +82,7 @@ class RuleEdit(QWidget):
' tags, you can replace with parts of the matched pattern. See '
' the User Manual on how to use regular expressions for details.')
REGEXP_HELP_TEXT = _('For help with regex pattern matching, see the <a href="%s">User Manual</a>')
SINGLE_EDIT_FIELD_NAME = 'tags'
def __init__(self, parent=None):
QWidget.__init__(self, parent)