File tree 3 files changed +12
-1
lines changed
3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,11 @@ def identifier_friendly(self):
341
341
def is_editable (self ):
342
342
return self .type == BRANCH
343
343
344
+ @property
345
+ def supports_wipe (self ):
346
+ """Return True if version is not external."""
347
+ return not self .type == EXTERNAL
348
+
344
349
def get_subdomain_url (self ):
345
350
private = self .privacy_level == PRIVATE
346
351
return self .project .get_docs_url (
Original file line number Diff line number Diff line change @@ -66,3 +66,9 @@ def test_commit_name_for_latest_version(self):
66
66
67
67
def test_commit_name_for_external_version (self ):
68
68
self .assertEqual (self .external_version .commit_name , self .external_version .identifier )
69
+
70
+ def test_version_does_not_support_wipe (self ):
71
+ self .assertFalse (self .external_version .supports_wipe )
72
+
73
+ def test_version_supports_wipe (self ):
74
+ self .assertTrue (self .branch_version .supports_wipe )
Original file line number Diff line number Diff line change 122
122
</ div >
123
123
124
124
{% if request.user|is_admin:project %}
125
- {% if not build.success and build.commands.count < 4 %}
125
+ {% if not build.success and build.commands.count < 4 and build.version.supports_wipe %}
126
126
< div class ="build-ideas ">
127
127
< p >
128
128
{% url 'wipe_version' build.version.project.slug build.version.slug as wipe_url %}
You can’t perform that action at this time.
0 commit comments