diff --git a/project/accounts/forms.py b/project/accounts/forms.py index af0d18db..723854c1 100644 --- a/project/accounts/forms.py +++ b/project/accounts/forms.py @@ -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 @@ -110,6 +111,7 @@ class ProfileEditForm(forms.ModelForm): class Meta: model = Profile + fields = [ "first_name", "last_name", @@ -117,6 +119,7 @@ class Meta: "profile_image", "username", "email", + "categories", ] first_name = forms.CharField(label="First Name", max_length=63, required=False) @@ -125,6 +128,11 @@ class Meta: 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(), + ) class UpdatePassword(forms.ModelForm): diff --git a/project/accounts/templates/accounts/account.html b/project/accounts/templates/accounts/account.html index e9c6602b..9858595d 100644 --- a/project/accounts/templates/accounts/account.html +++ b/project/accounts/templates/accounts/account.html @@ -22,15 +22,15 @@ {% if not profile == request.user.profile %} - {% if profile not in request.user.profile.following.all %} - - follow - - {% else %} - - unfollow - - {% endif %} + {% if profile not in request.user.profile.following.all %} + + follow + + {% else %} + + unfollow + + {% endif %} {% endif %}
diff --git a/project/accounts/templates/accounts/settings.html b/project/accounts/templates/accounts/settings.html index 8fb956d2..b61d8f00 100644 --- a/project/accounts/templates/accounts/settings.html +++ b/project/accounts/templates/accounts/settings.html @@ -10,75 +10,75 @@ {% block content %}