Permalink
Browse files

prevent from excluding current SDK

  • Loading branch information...
1 parent 73042ba commit 395187a4968264f33d6967e2f034a8fbb1ddfcb7 @zalun zalun committed Jan 27, 2012
Showing with 4 additions and 3 deletions.
  1. +3 −2 apps/jetpack/managers.py
  2. +1 −1 apps/jetpack/views.py
@@ -15,10 +15,11 @@
class SDKManager(models.Manager):
" manager for SDK class "
- def exclude_disabled(self):
+ def exclude_disabled(self, current=None):
query = self
for disabled in settings.DISABLED_SDKS:
- query = query.exclude(version=disabled)
+ if not current or current != disabled:
+ query = query.exclude(version=disabled)
return query.all()
class PackageManager(QuerySetManager):
@@ -148,7 +148,7 @@ def edit(request, revision):
sdk_list = None
if revision.package.is_addon():
library_counter += 1
- sdk_list = SDK.objects.exclude_disabled()
+ sdk_list = SDK.objects.exclude_disabled(current=revision.sdk.version)
return render(request,
"%s_edit.html" % revision.package.get_type_name(), {

0 comments on commit 395187a

Please sign in to comment.