Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Suppression de la synchronisation avec Hubspot #1305

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,6 @@

BREVO_TENDERS_MIN_AMOUNT_TO_SEND = env.int("BREVO_TENDERS_MIN_AMOUNT_TO_SEND", 34998)

# -- hubspot
HUBSPOT_API_KEY = env.str("HUBSPOT_API_KEY", "set-it")
HUBSPOT_IS_ACTIVATED = env.bool("HUBSPOT_IS_ACTIVATED", False)

# Caching
# https://docs.djangoproject.com/en/4.0/topics/cache/
# ------------------------------------------------------------------------------
Expand Down
132 changes: 0 additions & 132 deletions lemarche/notes/management/commands/import_notes_from_hubspot.py

This file was deleted.

21 changes: 21 additions & 0 deletions lemarche/tenders/migrations/0090_tender_remove_hubspot_deal_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.13 on 2024-06-26 13:11

from django.db import migrations


def remove_hubspot_deal_id(apps, schema_editor):
Tender = apps.get_model("tenders", "Tender")
for tender in Tender.objects.all():
if "hubspot_deal_id" in tender.extra_data:
del tender.extra_data["hubspot_deal_id"]
tender.save()


class Migration(migrations.Migration):
dependencies = [
("tenders", "0089_tender_le_marche_doesnt_exist_how_to_find_siae"),
]

operations = [
migrations.RunPython(remove_hubspot_deal_id, migrations.RunPython.noop),
]
9 changes: 0 additions & 9 deletions lemarche/tenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,10 +926,6 @@ def start_working_date_outdated(self):
return True
return False

@property
def hubspot_deal_id(self):
return self.extra_data.get("hubspot_deal_id")

@property
def siae_detail_display_date_count(self):
return self.tendersiae_set.filter(detail_display_date__isnull=False).count()
Expand Down Expand Up @@ -962,11 +958,6 @@ def get_absolute_url(self):
def get_admin_url(self):
return get_object_admin_url(self)

def set_hubspot_id(self, hubspot_deal_id, with_save=True):
self.extra_data.update({"hubspot_deal_id": hubspot_deal_id})
if with_save:
self.save()

@property
def is_draft(self) -> bool:
return self.status == tender_constants.STATUS_DRAFT
Expand Down
21 changes: 21 additions & 0 deletions lemarche/users/migrations/0038_user_remove_hubspot_contact_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.13 on 2024-06-26 13:00

from django.db import migrations


def remove_hubspot_contact_id(apps, schema_editor):
User = apps.get_model("users", "User")
for user in User.objects.all():
if "hubspot_contact_id" in user.extra_data:
del user.extra_data["hubspot_contact_id"]
user.save()


class Migration(migrations.Migration):
dependencies = [
("users", "0037_rename_extra_data_last_year_key"),
]

operations = [
migrations.RunPython(remove_hubspot_contact_id, migrations.RunPython.noop),
]
9 changes: 0 additions & 9 deletions lemarche/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,6 @@ def save(self, *args, **kwargs):
self.set_last_updated_fields()
super().save(*args, **kwargs)

def set_hubspot_id(self, hubspot_contact_id, with_save=True):
self.extra_data.update({"hubspot_contact_id": hubspot_contact_id})
if with_save:
self.save()

@property
def hubspot_contact_id(self):
return self.extra_data.get("hubspot_contact_id")

@property
def full_name(self):
return f"{self.first_name} {self.last_name}"
Expand Down
Loading
Loading