Fix profile model. Add OneToOne relation, fix image dir path
This commit is contained in:
parent
234669242f
commit
5e5bec6028
@ -1,8 +1,10 @@
|
||||
import os
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
|
||||
|
||||
class UserProfile(models.Model):
|
||||
user = models.OneToOneField(to=User, on_delete=models.CASCADE)
|
||||
role = models.IntegerField()
|
||||
image = models.ImageField(upload_to=os.path.join('media', 'user_avatars'))
|
||||
image = models.ImageField(upload_to='user_avatars')
|
||||
|
Loading…
x
Reference in New Issue
Block a user