Skip to content

Commit

Permalink
fix: add notifs on demo clouds (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
amineau authored Oct 17, 2023
1 parent a89c0dc commit d82b074
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions user/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from externals.bimdata_api import ApiClient
from utils import mails
from webhooks.utils import register_webhook


class User(AbstractUser):
Expand Down Expand Up @@ -65,6 +66,15 @@ def create_demo(self, access_token=None):
cloud = client.collaboration_api.create_cloud(
{"name": f"{self.first_name} {self.last_name}"}
)
register_webhook(
cloud_id=cloud["id"],
events=[
"bcf.topic.creation",
"visa.validation.add",
"visa.validation.remove",
],
access_token=access_token,
)
with open("demo_icon.png", "rb") as file:
demo_icon = ("image", ("demo_icon.png", file))
response = requests.patch(
Expand Down

0 comments on commit d82b074

Please sign in to comment.