Skip to content

Commit

Permalink
Merge pull request #697 from ita-social-projects/696-profile-moderati…
Browse files Browse the repository at this point in the history
…on-add-status_updated_at-field-to-the-profile-entity

Added status_updated_at field to Profile model
  • Loading branch information
AlexanderSychev2005 authored Jul 19, 2024
2 parents ee7d0cc + edb6a17 commit d3acee3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions BackEnd/profiles/migrations/0019_profile_status_updated_at.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.3 on 2024-07-17 14:15

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):
dependencies = [
("profiles", "0018_profile_status"),
]

operations = [
migrations.AddField(
model_name="profile",
name="status_updated_at",
field=models.DateTimeField(default=django.utils.timezone.now),
),
]
2 changes: 2 additions & 0 deletions BackEnd/profiles/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.db import models
from django.core.validators import MaxLengthValidator
from django.utils.timezone import now

from authentication.models import CustomUser
from images.models import ProfileImage
Expand Down Expand Up @@ -120,6 +121,7 @@ class Profile(models.Model):
is_deleted = models.BooleanField(default=False)
created_at = models.DateField(auto_now_add=True)
updated_at = models.DateField(auto_now=True)
status_updated_at = models.DateTimeField(default=now)
completeness = models.SmallIntegerField(default=0)
status = models.CharField(
max_length=15, choices=STATUS_CHOICES, default="undefined"
Expand Down

0 comments on commit d3acee3

Please sign in to comment.