Added a ModelForm to change profile details.

This commit is contained in:
Marcus Scholz 2020-12-24 20:31:52 +01:00
parent 3855fb28d7
commit 53f89caef5

View File

@ -8,7 +8,7 @@ from django.db import models
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from lostplaces.models import Place, PlaceImage, Voucher
from lostplaces.models import Place, PlaceImage, Voucher, Explorer
class SignupVoucherForm(UserCreationForm):
class Meta:
@ -35,6 +35,12 @@ class SignupVoucherForm(UserCreationForm):
fetched_voucher.delete()
return True
class ProfileChangeForm(forms.ModelForm):
class Meta:
model = Explorer
fields = '__all__'
exclude = ['user', 'favorite_places']
class PlaceForm(forms.ModelForm):
class Meta:
model = Place