Skip to content

Commit

Permalink
feat: add user picture url field
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv9449 committed Apr 12, 2024
1 parent 56f0be6 commit c1db31a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ class UserLoginSerializer(serializers.ModelSerializer):

class Meta:
model = User
fields = ["username", "name", "is_faculty", "verified"]
fields = ["username", "picture_url", "name", "is_faculty", "verified"]


class UserDetailSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = [
"username",
"picture_url",
"name",
"email",
"phone_no",
Expand All @@ -41,6 +42,7 @@ class Meta:
fields = [
"id",
"username",
"picture_url",
"name",
"email",
"phone_no",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.10 on 2024-04-12 04:53

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0007_user_office_location'),
]

operations = [
migrations.AddField(
model_name='user',
name='picture_url',
field=models.URLField(blank=True, verbose_name="URL of the user's profile picture"),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class User(AbstractUser):
max_length=4,
validators=[validate_tenure],
)
picture_url = models.URLField(_("URL of the user's profile picture"), blank=True)
verified = models.BooleanField(default=False)
is_faculty = models.BooleanField(_("User is faculty"), default=False)
is_dsw = models.BooleanField(_("User is DSW"), default=False)
Expand Down

0 comments on commit c1db31a

Please sign in to comment.