Skip to content

Commit

Permalink
Added categories to user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
TimOsahenru committed Nov 2, 2022
1 parent c359526 commit 2f63423
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions project/accounts/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re

from accounts.models import Profile
from categories.models import Category
from django import forms
from django.contrib.auth import get_user_model
from django.core.files.images import get_image_dimensions
Expand Down Expand Up @@ -120,19 +121,18 @@ class Meta:
"email",
"categories",
]
widgets = {"categories": forms.CheckboxSelectMultiple()}

first_name = forms.CharField(label="First Name", max_length=63, required=False)
last_name = forms.CharField(label="Last Name", max_length=63, required=False)
about_me = forms.CharField(label="About Me", max_length=511, required=False)
email = forms.EmailField(label="Email", disabled=True)
username = forms.CharField(label="Username", disabled=True)
profile_image = forms.ImageField(required=False)
# categories = forms.ModelMultipleChoiceField(
# queryset=Category.objects.all(),
# required=False,
# widget=forms.CheckboxSelectMultiple
# )
categories = forms.ModelMultipleChoiceField(
queryset=Category.objects.all(),
required=False,
widget=forms.CheckboxSelectMultiple(),
)


class UpdatePassword(forms.ModelForm):
Expand Down

0 comments on commit 2f63423

Please sign in to comment.