Skip to content

Commit

Permalink
Merge pull request #671 from ita-social-projects/#668-profile-entity-…
Browse files Browse the repository at this point in the history
…new-field

#668 profile entity new field
  • Loading branch information
superolegatron authored Jul 10, 2024
2 parents 98f831c + 7e981b6 commit 3c02a88
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
27 changes: 27 additions & 0 deletions BackEnd/profiles/migrations/0018_profile_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.3 on 2024-07-05 11:48

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("profiles", "0017_remove_profile_banner_image_and_more"),
]

operations = [
migrations.AddField(
model_name="profile",
name="status",
field=models.CharField(
choices=[
("undefined", "Undefined"),
("pending", "Pending Moderation"),
("blocked", "Blocked"),
("approved", "Approved"),
("auto_approved", "Auto Approved"),
],
default="undefined",
max_length=15,
),
),
]
11 changes: 11 additions & 0 deletions BackEnd/profiles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ def __str__(self):


class Profile(models.Model):
STATUS_CHOICES = [
("undefined", "Undefined"),
("pending", "Pending Moderation"),
("blocked", "Blocked"),
("approved", "Approved"),
("auto_approved", "Auto Approved"),
]

id = models.AutoField(primary_key=True)

name = models.CharField(max_length=100, default=None, null=True)
Expand Down Expand Up @@ -113,6 +121,9 @@ class Profile(models.Model):
created_at = models.DateField(auto_now_add=True)
updated_at = models.DateField(auto_now=True)
completeness = models.SmallIntegerField(default=0)
status = models.CharField(
max_length=15, choices=STATUS_CHOICES, default="undefined"
)

objects = ProfileManager.as_manager()

Expand Down

0 comments on commit 3c02a88

Please sign in to comment.