Skip to content

Commit

Permalink
chore: made account immutable to credential
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 20, 2024
1 parent 9f8cb40 commit c6e5d38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/appier_extras/parts/admin/models/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class Credential(base.Base):
index=True, immutable=True, description="Credential ID"
)

credential_data = appier.field()
credential_data = appier.field(immutable=True)

account = appier.field(type=appier.reference("Account", name="id"))
account = appier.field(type=appier.reference("Account", name="id"), immutable=True)

@classmethod
def validate(cls):
Expand All @@ -56,8 +56,8 @@ def validate(cls):
def list_names(cls):
return ["credential_id", "description", "account"]

def post_save(self):
base.Base.post_save(self)
def post_create(self):
base.Base.post_create(self)
account = self.account.reload()
if not self in account.credentials:
account.credentials.append(self)
Expand Down

0 comments on commit c6e5d38

Please sign in to comment.