style: apply black and isort formatting across entire codebase

- Standardize quote style (single to double quotes)
- Reorder and group imports alphabetically
- Fix line breaks and indentation for consistency
- Apply PEP 8 formatting standards

Also updated Makefile to exclude both venv and .venv from code quality checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-28 19:30:17 +01:00
parent 13f0094743
commit 21c13ca39b
236 changed files with 8450 additions and 6545 deletions

View File

@@ -46,16 +46,22 @@ def create_platform_pages():
print("1. Creating Platform Homepage...")
# Check if already exists
existing = db.query(ContentPage).filter_by(vendor_id=None, slug="platform_homepage").first()
existing = (
db.query(ContentPage)
.filter_by(vendor_id=None, slug="platform_homepage")
.first()
)
if existing:
print(f" ⚠️ Skipped: Platform Homepage - already exists (ID: {existing.id})")
print(
f" ⚠️ Skipped: Platform Homepage - already exists (ID: {existing.id})"
)
else:
try:
homepage = content_page_service.create_page(
db,
slug="platform_homepage",
title="Welcome to Our Multi-Vendor Marketplace",
content="""
db,
slug="platform_homepage",
title="Welcome to Our Multi-Vendor Marketplace",
content="""
<p class="lead">
Connect vendors with customers worldwide. Build your online store and reach millions of shoppers.
</p>
@@ -64,14 +70,14 @@ def create_platform_pages():
with minimal effort and maximum impact.
</p>
""",
template="modern", # Uses platform/homepage-modern.html
vendor_id=None, # Platform-level page
is_published=True,
show_in_header=False, # Homepage is not in menu (it's the root)
show_in_footer=False,
display_order=0,
template="modern", # Uses platform/homepage-modern.html
vendor_id=None, # Platform-level page
is_published=True,
show_in_header=False, # Homepage is not in menu (it's the root)
show_in_footer=False,
display_order=0,
meta_description="Leading multi-vendor marketplace platform. Connect with thousands of vendors and discover millions of products.",
meta_keywords="marketplace, multi-vendor, e-commerce, online shopping, platform"
meta_keywords="marketplace, multi-vendor, e-commerce, online shopping, platform",
)
print(f" ✅ Created: {homepage.title} (/{homepage.slug})")
except Exception as e:
@@ -88,10 +94,10 @@ def create_platform_pages():
else:
try:
about = content_page_service.create_page(
db,
slug="about",
title="About Us",
content="""
db,
slug="about",
title="About Us",
content="""
<h2>Our Mission</h2>
<p>
We're on a mission to democratize e-commerce by providing powerful,
@@ -121,13 +127,13 @@ def create_platform_pages():
<li><strong>Excellence:</strong> We strive for the highest quality in everything we do</li>
</ul>
""",
vendor_id=None,
is_published=True,
show_in_header=True, # Show in header navigation
show_in_footer=True, # Show in footer
display_order=1,
vendor_id=None,
is_published=True,
show_in_header=True, # Show in header navigation
show_in_footer=True, # Show in footer
display_order=1,
meta_description="Learn about our mission to democratize e-commerce and empower entrepreneurs worldwide.",
meta_keywords="about us, mission, vision, values, company"
meta_keywords="about us, mission, vision, values, company",
)
print(f" ✅ Created: {about.title} (/{about.slug})")
except Exception as e:
@@ -144,10 +150,10 @@ def create_platform_pages():
else:
try:
faq = content_page_service.create_page(
db,
slug="faq",
title="Frequently Asked Questions",
content="""
db,
slug="faq",
title="Frequently Asked Questions",
content="""
<h2>Getting Started</h2>
<h3>How do I create a vendor account?</h3>
@@ -204,13 +210,13 @@ def create_platform_pages():
and marketing tools.
</p>
""",
vendor_id=None,
is_published=True,
show_in_header=True, # Show in header navigation
show_in_footer=True,
display_order=2,
vendor_id=None,
is_published=True,
show_in_header=True, # Show in header navigation
show_in_footer=True,
display_order=2,
meta_description="Find answers to common questions about our marketplace platform.",
meta_keywords="faq, frequently asked questions, help, support"
meta_keywords="faq, frequently asked questions, help, support",
)
print(f" ✅ Created: {faq.title} (/{faq.slug})")
except Exception as e:
@@ -221,16 +227,18 @@ def create_platform_pages():
# ========================================================================
print("4. Creating Contact Us page...")
existing = db.query(ContentPage).filter_by(vendor_id=None, slug="contact").first()
existing = (
db.query(ContentPage).filter_by(vendor_id=None, slug="contact").first()
)
if existing:
print(f" ⚠️ Skipped: Contact Us - already exists (ID: {existing.id})")
else:
try:
contact = content_page_service.create_page(
db,
slug="contact",
title="Contact Us",
content="""
db,
slug="contact",
title="Contact Us",
content="""
<h2>Get in Touch</h2>
<p>
We'd love to hear from you! Whether you have questions about our platform,
@@ -271,13 +279,13 @@ def create_platform_pages():
Email: <a href="mailto:press@marketplace.com">press@marketplace.com</a>
</p>
""",
vendor_id=None,
is_published=True,
show_in_header=True, # Show in header navigation
show_in_footer=True,
display_order=3,
vendor_id=None,
is_published=True,
show_in_header=True, # Show in header navigation
show_in_footer=True,
display_order=3,
meta_description="Get in touch with our team. We're here to help you succeed.",
meta_keywords="contact, support, email, phone, address"
meta_keywords="contact, support, email, phone, address",
)
print(f" ✅ Created: {contact.title} (/{contact.slug})")
except Exception as e:
@@ -290,14 +298,16 @@ def create_platform_pages():
existing = db.query(ContentPage).filter_by(vendor_id=None, slug="terms").first()
if existing:
print(f" ⚠️ Skipped: Terms of Service - already exists (ID: {existing.id})")
print(
f" ⚠️ Skipped: Terms of Service - already exists (ID: {existing.id})"
)
else:
try:
terms = content_page_service.create_page(
db,
slug="terms",
title="Terms of Service",
content="""
db,
slug="terms",
title="Terms of Service",
content="""
<p><em>Last updated: January 1, 2024</em></p>
<h2>1. Acceptance of Terms</h2>
@@ -361,13 +371,13 @@ def create_platform_pages():
<a href="mailto:legal@marketplace.com">legal@marketplace.com</a>.
</p>
""",
vendor_id=None,
is_published=True,
show_in_header=False, # Too legal for header
show_in_footer=True, # Show in footer
display_order=10,
vendor_id=None,
is_published=True,
show_in_header=False, # Too legal for header
show_in_footer=True, # Show in footer
display_order=10,
meta_description="Read our terms of service and platform usage policies.",
meta_keywords="terms of service, terms, legal, policy, agreement"
meta_keywords="terms of service, terms, legal, policy, agreement",
)
print(f" ✅ Created: {terms.title} (/{terms.slug})")
except Exception as e:
@@ -378,16 +388,18 @@ def create_platform_pages():
# ========================================================================
print("6. Creating Privacy Policy page...")
existing = db.query(ContentPage).filter_by(vendor_id=None, slug="privacy").first()
existing = (
db.query(ContentPage).filter_by(vendor_id=None, slug="privacy").first()
)
if existing:
print(f" ⚠️ Skipped: Privacy Policy - already exists (ID: {existing.id})")
else:
try:
privacy = content_page_service.create_page(
db,
slug="privacy",
title="Privacy Policy",
content="""
db,
slug="privacy",
title="Privacy Policy",
content="""
<p><em>Last updated: January 1, 2024</em></p>
<h2>1. Information We Collect</h2>
@@ -453,13 +465,13 @@ def create_platform_pages():
<a href="mailto:privacy@marketplace.com">privacy@marketplace.com</a>.
</p>
""",
vendor_id=None,
is_published=True,
show_in_header=False, # Too legal for header
show_in_footer=True, # Show in footer
display_order=11,
vendor_id=None,
is_published=True,
show_in_header=False, # Too legal for header
show_in_footer=True, # Show in footer
display_order=11,
meta_description="Learn how we collect, use, and protect your personal information.",
meta_keywords="privacy policy, privacy, data protection, gdpr, personal information"
meta_keywords="privacy policy, privacy, data protection, gdpr, personal information",
)
print(f" ✅ Created: {privacy.title} (/{privacy.slug})")
except Exception as e: