diff --git a/apps/orgs/models.py b/apps/orgs/models.py index e61239a..171b23a 100644 --- a/apps/orgs/models.py +++ b/apps/orgs/models.py @@ -21,8 +21,9 @@ class Org(models.Model): allow_travelperk = models.BooleanField(default=True, help_text='Allow Travelperk') allow_gusto = models.BooleanField(default=False, help_text='Allow Gusto') allow_dynamics = models.BooleanField(default=False, help_text='Allow Dynamics') + allow_qbd_direct_integration = models.BooleanField(default=False, help_text='Allow QBD Direct Integration') created_at = models.DateTimeField(auto_now_add=True, help_text='Created at datetime') - updated_at = models.DateTimeField(auto_now=True, help_text='Updated at datetime') + updated_at = models.DateTimeField(auto_now=True, help_text='Updated at datetime') class Meta: db_table = 'orgs' diff --git a/apps/orgs/serializers.py b/apps/orgs/serializers.py index 055ce8c..a68e69f 100644 --- a/apps/orgs/serializers.py +++ b/apps/orgs/serializers.py @@ -49,7 +49,8 @@ def update(self, instance, validated): else: auth_tokens = AuthToken.objects.get(user__user_id=self.context['request'].user) cluster_domain = get_cluster_domain(auth_tokens.refresh_token) - org = Org.objects.create(name=org_name, fyle_org_id=org_id, cluster_domain=cluster_domain) + allow_qbd_direct_integration = validated.get('allow_qbd_direct_integration', False) + org = Org.objects.create(name=org_name, fyle_org_id=org_id, cluster_domain=cluster_domain, allow_qbd_direct_integration=allow_qbd_direct_integration) org.user.add(User.objects.get(user_id=self.context['request'].user)) FyleCredential.objects.update_or_create(