Permalink
Browse files

Take into account that existing_package can be None.

  • Loading branch information...
1 parent 6328e19 commit 313b38956017d2d36e31681917e5caf1cd14df60 Mark van Lent committed Apr 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 whiskers/views.py
View
@@ -45,7 +45,7 @@ def prepare_packages(session, packages):
else:
version = Version(package['version'])
- if not existing_package.count():
+ if not (existing_package and existing_package.count()):
package_item = Package(package['name'], version)
else:
package_item = existing_package.first()

0 comments on commit 313b389

Please sign in to comment.