Skip to content

Commit 06f135c

Browse files
authored
Merge pull request #6819 from readthedocs/hide-profile
Allow to override ProfileDetail view
2 parents 7cd3df4 + d8471be commit 06f135c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

readthedocs/profiles/views.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
DetailView,
1515
FormView,
1616
ListView,
17-
UpdateView
17+
UpdateView,
1818
)
1919

2020
from readthedocs.core.forms import (
@@ -24,6 +24,7 @@
2424
)
2525
from readthedocs.core.mixins import PrivateViewMixin
2626
from readthedocs.core.models import UserProfile
27+
from readthedocs.core.utils.extend import SettingsOverrideObject
2728

2829

2930
class ProfileEdit(PrivateViewMixin, UpdateView):
@@ -67,7 +68,7 @@ def get_success_url(self):
6768
return reverse('homepage')
6869

6970

70-
class ProfileDetail(DetailView):
71+
class ProfileDetailBase(DetailView):
7172

7273
model = User
7374
template_name = 'profiles/public/profile_detail.html'
@@ -79,6 +80,11 @@ def get_context_data(self, **kwargs):
7980
return context
8081

8182

83+
class ProfileDetail(SettingsOverrideObject):
84+
85+
_default_class = ProfileDetailBase
86+
87+
8288
class AccountAdvertisingEdit(PrivateViewMixin, SuccessMessageMixin, UpdateView):
8389

8490
model = UserProfile

0 commit comments

Comments
 (0)