ExplorerChangeForms, with deactivated username field.

This commit is contained in:
2020-12-25 01:31:01 +01:00
parent 4f0182fc3e
commit 7359bf5fab
4 changed files with 84 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ from lostplaces.common import get_all_subclasses
from lostplaces.views.base_views import IsAuthenticatedMixin
from lostplaces.models.models import Explorer
from lostplaces.models.place import Place, PlaceAsset
from lostplaces.forms import ExplorerChangeForm, ExplorerUserChangeForm
class ExplorerProfileView(IsAuthenticatedMixin, View):
def get(self, request, explorer_id):
@@ -39,3 +40,15 @@ class ExplorerProfileView(IsAuthenticatedMixin, View):
template_name='explorer/profile.html',
context=context
)
class ExplorerProfileUpdateView(IsAuthenticatedMixin, View):
success_message = ''
permission_denied_message = ''
def get(self, request, *args, **kwargs):
context = {
'explorer_image_url': request.user.explorer.profile_image.url,
'explorer_user_change_form': ExplorerUserChangeForm(instance=request.user),
'explorer_change_form': ExplorerChangeForm(instance=request.user.explorer)
}
return render(request, 'explorer/profile_update.html', context)