From a7b348ffffaaa61ebb550cedb94c12d1913f1f5a Mon Sep 17 00:00:00 2001 From: JisanAR03 Date: Wed, 3 Jul 2024 20:52:43 +0600 Subject: [PATCH] fix 2380 issue --- blt/urls.py | 4 +++- website/migrations/0094_company_company_id.py | 19 +++++++++++++++++++ website/models.py | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 website/migrations/0094_company_company_id.py diff --git a/blt/urls.py b/blt/urls.py index 93d101312..d41784aa6 100644 --- a/blt/urls.py +++ b/blt/urls.py @@ -127,7 +127,9 @@ handler500 = "website.views.handler500" urlpatterns = [ - path("company/", CompanyViewSet.as_view({"get": "list", "post": "create"}), name="company"), + path( + "api/companies/", CompanyViewSet.as_view({"get": "list", "post": "create"}), name="company" + ), path("invite-friend/", website.views.invite_friend, name="invite_friend"), path("referral/", website.views.referral_signup, name="referral_signup"), path("captcha/", include("captcha.urls")), diff --git a/website/migrations/0094_company_company_id.py b/website/migrations/0094_company_company_id.py new file mode 100644 index 000000000..f46aa6bdd --- /dev/null +++ b/website/migrations/0094_company_company_id.py @@ -0,0 +1,19 @@ +# Generated by Django 5.0.6 on 2024-07-02 20:26 + +import uuid + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("website", "0093_bid_bch_address"), + ] + + operations = [ + migrations.AddField( + model_name="company", + name="company_id", + field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True), + ), + ] diff --git a/website/models.py b/website/models.py index 20f8a4d00..e8f5ffadd 100644 --- a/website/models.py +++ b/website/models.py @@ -51,6 +51,7 @@ def generate_uuid_for_company(apps, schema_editor): class Company(models.Model): + company_id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) admin = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE) managers = models.ManyToManyField(User, related_name="user_companies") name = models.CharField(max_length=255)