ExplorerChangeForms, with deactivated username field.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user