poprawka w format_host
This commit is contained in:
parent
1a1e84ad11
commit
88583dba31
19
app.py
19
app.py
@ -1271,15 +1271,16 @@ def deploy_user(user_id):
|
|||||||
else:
|
else:
|
||||||
chosen_file = default_file
|
chosen_file = default_file
|
||||||
|
|
||||||
# 🛠 Upewniamy się, że final_content nigdy nie jest pusty
|
# 🛠 Jeśli disable_local_default jest włączone → wgraj tylko wybrany plik hosts
|
||||||
final_content = chosen_file.content if chosen_file.content.strip() else "# Empty /etc/hosts file\n"
|
if h.disable_local_default:
|
||||||
|
final_content = chosen_file.content.strip()
|
||||||
# Dodaj regex, jeśli nie jest wyłączony
|
else:
|
||||||
if not h.disable_regex_deploy and regex_lines.strip():
|
# W przeciwnym wypadku dodaj regex i ensure_local_defaults
|
||||||
final_content = regex_lines + "\n" + final_content
|
final_content = chosen_file.content.strip()
|
||||||
|
|
||||||
# Dodaj local-defaults, jeśli nie jest wyłączony
|
if not h.disable_regex_deploy and regex_lines.strip():
|
||||||
if not h.disable_local_default:
|
final_content = regex_lines + "\n" + final_content
|
||||||
|
|
||||||
final_content = ensure_local_defaults(final_content, user_id)
|
final_content = ensure_local_defaults(final_content, user_id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user