diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index 8040b57..13a0666 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index a682bb2..6e3aca3 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index c8e66eb..820c80a 100644 --- a/core/admin.py +++ b/core/admin.py @@ -124,7 +124,7 @@ class PlatformProfileAdmin(admin.ModelAdmin): 'fields': ('name', 'logo', 'slogan', 'address', 'phone_number', 'registration_number', 'vat_number') }), (_('Policies'), { - 'fields': ('privacy_policy', 'terms_conditions') + 'fields': ('privacy_policy_en', 'privacy_policy_ar', 'terms_conditions_en', 'terms_conditions_ar') }), (_('Payment Configuration'), { 'fields': ('enable_payment',) diff --git a/core/migrations/0021_remove_platformprofile_privacy_policy_and_more.py b/core/migrations/0021_remove_platformprofile_privacy_policy_and_more.py new file mode 100644 index 0000000..d3b44e3 --- /dev/null +++ b/core/migrations/0021_remove_platformprofile_privacy_policy_and_more.py @@ -0,0 +1,41 @@ +# Generated by Django 5.2.7 on 2026-01-28 00:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0020_profile_is_approved'), + ] + + operations = [ + migrations.RemoveField( + model_name='platformprofile', + name='privacy_policy', + ), + migrations.RemoveField( + model_name='platformprofile', + name='terms_conditions', + ), + migrations.AddField( + model_name='platformprofile', + name='privacy_policy_ar', + field=models.TextField(blank=True, verbose_name='Privacy Policy (Arabic)'), + ), + migrations.AddField( + model_name='platformprofile', + name='privacy_policy_en', + field=models.TextField(blank=True, verbose_name='Privacy Policy (English)'), + ), + migrations.AddField( + model_name='platformprofile', + name='terms_conditions_ar', + field=models.TextField(blank=True, verbose_name='Terms and Conditions (Arabic)'), + ), + migrations.AddField( + model_name='platformprofile', + name='terms_conditions_en', + field=models.TextField(blank=True, verbose_name='Terms and Conditions (English)'), + ), + ] diff --git a/core/migrations/__pycache__/0021_remove_platformprofile_privacy_policy_and_more.cpython-311.pyc b/core/migrations/__pycache__/0021_remove_platformprofile_privacy_policy_and_more.cpython-311.pyc new file mode 100644 index 0000000..b657091 Binary files /dev/null and b/core/migrations/__pycache__/0021_remove_platformprofile_privacy_policy_and_more.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 5f44e60..6fca213 100644 --- a/core/models.py +++ b/core/models.py @@ -180,8 +180,12 @@ class PlatformProfile(models.Model): phone_number = models.CharField(_('Phone Number'), max_length=50, blank=True) registration_number = models.CharField(_('Registration Number'), max_length=100, blank=True) vat_number = models.CharField(_('VAT Number'), max_length=100, blank=True) - privacy_policy = models.TextField(_('Privacy Policy'), blank=True) - terms_conditions = models.TextField(_('Terms and Conditions'), blank=True) + + # Bilingual Policies + privacy_policy_en = models.TextField(_('Privacy Policy (English)'), blank=True) + privacy_policy_ar = models.TextField(_('Privacy Policy (Arabic)'), blank=True) + terms_conditions_en = models.TextField(_('Terms and Conditions (English)'), blank=True) + terms_conditions_ar = models.TextField(_('Terms and Conditions (Arabic)'), blank=True) # WhatsApp Configuration (Wablas Gateway) whatsapp_access_token = models.TextField(_('Wablas API Token'), blank=True, help_text=_("Your Wablas API Token.")) @@ -191,6 +195,18 @@ class PlatformProfile(models.Model): # Payment Configuration enable_payment = models.BooleanField(_('Enable Payment'), default=True, help_text=_("Toggle to enable or disable payments on the platform.")) + @property + def privacy_policy(self): + if get_language() == 'ar': + return self.privacy_policy_ar + return self.privacy_policy_en + + @property + def terms_conditions(self): + if get_language() == 'ar': + return self.terms_conditions_ar + return self.terms_conditions_en + def save(self, *args, **kwargs): # Auto-clean whitespace from credentials if self.whatsapp_access_token: