', r'
#
#
pattern = r'(
\s*\s*
)'
def replacer(match):
return f"\n{match.group(1)}\n"
content = re.sub(pattern, replacer, content, flags=re.DOTALL)
# Also restrict the button "إدارة الدورات الموسمية"
#
إدارة الدورات الموسمية
# We should hide this button for center_admin
btn_pattern = r'(
إدارة الدورات الموسمية)'
content = re.sub(btn_pattern, r'\1', content)
with open(file, 'w', encoding='utf-8') as f:
f.write(content)