Skip to content

Commit

Permalink
Improved ldap import user routine (fix for #3186)
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzieIsaacs committed Oct 25, 2024
1 parent cd01aaa commit abedb13
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cps/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,7 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support):


def extract_user_data_from_field(user, field):
match = re.search(field + r"=([@\.\d\s\w-]+)", user, re.IGNORECASE | re.UNICODE)
match = re.search(field + r"=(.*?)($|(?<!\\),)", user, re.IGNORECASE | re.UNICODE)
if match:
return match.group(1)
else:
Expand Down
15 changes: 8 additions & 7 deletions cps/tasks/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,15 @@ def _convert_calibre(self, file_path, format_old_ext, format_new_ext, has_cover)
command.extend(['--from-opf', path_tmp_opf])
if has_cover:
command.extend(['--cover', os.path.join(os.path.dirname(file_path), 'cover.jpg')])
quotes_index = 3
# quotes_index = 3
if config.config_calibre:
parameters = config.config_calibre.split(" ")
for param in parameters:
command.append(param)
quotes.append(quotes_index)
quotes_index += 1

parameters = re.findall(r"--[\w-]+(?:(\s(?:(\".+\")|(?:.+?)|(?:(\'.+\'))))(?:\s|$))?",
config.config_calibre, re.IGNORECASE | re.UNICODE)
if parameters:
for param in parameters:
command.append(param)
#quotes.append(quotes_index)
#quotes_index += 1
p = process_open(command, quotes, newlines=False)
except OSError as e:
return 1, N_("Ebook-converter failed: %(error)s", error=e)
Expand Down

0 comments on commit abedb13

Please sign in to comment.