Skip to content

Commit 558ce09

Browse files
authored
Merge pull request #693 from dodo920306/fix/create-time-always-now
Fix user creation time always be shown as now
2 parents d45c9c3 + 7cec549 commit 558ce09

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/api-engine/api/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class UserProfile(AbstractUser):
117117
organization = models.ForeignKey(
118118
Organization, null=True, on_delete=models.CASCADE, related_name="users",
119119
)
120+
created_at = models.DateTimeField(auto_now_add=True)
120121
USERNAME_FIELD = 'email'
121122
REQUIRED_FIELDS = []
122123

src/api-engine/api/routes/user/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class UserInfoSerializer(serializers.ModelSerializer):
6767

6868
class Meta:
6969
model = UserProfile
70-
fields = ("id", "username", "role", "organization")
70+
fields = ("id", "username", "role", "organization", "created_at")
7171
extra_kwargs = {
7272
"id": {"read_only": False},
7373
"username": {"validators": []},

0 commit comments

Comments
 (0)