Skip to content

Commit

Permalink
Ajustando foto de perfil no model
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus-dev-fullstack committed Nov 2, 2024
1 parent fda3cfe commit 4ffb713
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
Binary file modified db.sqlite3
Binary file not shown.
Binary file modified posts/viewsets/__pycache__/post_viewset.cpython-312.pyc
Binary file not shown.
Binary file modified usuarios/__pycache__/models.cpython-312.pyc
Binary file not shown.
18 changes: 18 additions & 0 deletions usuarios/migrations/0009_usuario_perfilphoto.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.1.2 on 2024-11-02 00:38

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('usuarios', '0008_remove_usuario_perfilphoto'),
]

operations = [
migrations.AddField(
model_name='usuario',
name='perfilPhoto',
field=models.ImageField(blank=True, default='perfilPhoto/perfil-default.jpg', null=True, upload_to='perfilPhoto'),
),
]
Binary file not shown.
2 changes: 1 addition & 1 deletion usuarios/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Usuario(AbstractUser):
password = models.CharField(max_length=100)
isVerified = models.BooleanField(default=False)
about = models.TextField(max_length=200, blank=True)
# perfilPhoto = models.ImageField(upload_to='perfilPhoto', blank=True, default="perfilPhoto/perfil-default.jpg", null=True)
perfilPhoto = models.ImageField(upload_to='perfilPhoto', blank=True, default="perfilPhoto/perfil-default.jpg", null=True)

def save(self, *args, **kwargs):
if not self.password.startswith('pbkdf2_'): # Verifica se já é um hash
Expand Down

0 comments on commit 4ffb713

Please sign in to comment.