views: look for scope-specific template for edit page (#22401)

This commit is contained in:
Frédéric Péters 2018-03-09 12:35:17 +01:00
parent 6fd389ddf1
commit 19c3da50b7
1 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,13 @@ class EditProfile(cbv.HookMixin, cbv.TemplateNamesMixin, UpdateView):
template_names = ['profiles/edit_profile.html',
'authentic2/accounts_edit.html']
def get_template_names(self):
template_names = []
if 'scope' in self.kwargs:
template_names.append('authentic2/accounts_edit_%s.html' % self.kwargs['scope'])
template_names.extend(self.template_names)
return template_names
@classmethod
def can_edit_profile(cls):
fields, labels = cls.get_fields()