An AI agent for your development workflow that can search and manipulate the code base, browse the internet and interact with Github issues and pull requests
The PilotUser class has been updated to ensure that the linear_integration and slack_integration objects are created automatically by default when a PilotUser instance is created. The changes have been committed to the accounts/models.py file.
Here is the updated PilotUser class:
from django.contrib.auth.models import AbstractUser
from django.db import models
class LinearIntegration(models.Model):
# Define fields for LinearIntegration
pass
class SlackIntegration(models.Model):
# Define fields for SlackIntegration
pass
class PilotUser(AbstractUser):
linear_integration = models.OneToOneField(LinearIntegration, on_delete=models.CASCADE, null=True, blank=True)
slack_integration = models.OneToOneField(SlackIntegration, on_delete=models.CASCADE, null=True, blank=True)
def save(self, *args, **kwargs):
if not self.linear_integration:
self.linear_integration = LinearIntegration.objects.create()
if not self.slack_integration:
self.slack_integration = SlackIntegration.objects.create()
super().save(*args, **kwargs)
With this change, whenever a PilotUser instance is saved, it will automatically create and assign LinearIntegration and SlackIntegration objects if they do not already exist.
The
PilotUser
class has been updated to ensure that thelinear_integration
andslack_integration
objects are created automatically by default when aPilotUser
instance is created. The changes have been committed to theaccounts/models.py
file.Here is the updated
PilotUser
class:With this change, whenever a
PilotUser
instance is saved, it will automatically create and assignLinearIntegration
andSlackIntegration
objects if they do not already exist.