Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit 7061837

Browse files
committed
hide collections toggles on user profile edit page for apps (bug 707018)
1 parent 65bb384 commit 7061837

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

apps/users/templates/users/edit.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@
138138
{{ form.bio.errors }}
139139
</div>
140140
</fieldset> {# /.profile-detail #}
141+
{# TODO(apps): Revert this when we have collections for apps. #}
142+
{% if not webapp %}
141143
<fieldset id="profile-misc" class="c">
142144
<legend>{{ _('Miscellaneous') }}</legend>
143145
<p class="sub_legend">
@@ -162,6 +164,7 @@
162164
</li>
163165
</ul>
164166
</fieldset>
167+
{% endif %}
165168

166169
<fieldset id="acct-notify">
167170
<legend>{{ _('Notifications') }}</legend>

apps/users/tests/test_views.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,21 @@ def test_edit_notifications_non_dev_error(self):
231231
def test_edit_app_notifications_non_dev_error(self):
232232
self._test_edit_notifications_non_dev_error()
233233

234+
def test_collections_toggles(self):
235+
r = self.client.get(self.url)
236+
eq_(r.status_code, 200)
237+
doc = pq(r.content)
238+
eq_(doc('#profile-misc').length, 1,
239+
'Collections options should be visible.')
240+
241+
@patch.object(settings, 'APP_PREVIEW', True)
242+
def test_apps_collections_toggles(self):
243+
r = self.client.get(self.url)
244+
eq_(r.status_code, 200)
245+
doc = pq(r.content)
246+
eq_(doc('#profile-misc').length, 0,
247+
'Collections options should not be visible.')
248+
234249

235250
class TestEditAdmin(UserViewBase):
236251
fixtures = ['base/users']

0 commit comments

Comments
 (0)