diff rhodecode/model/__init__.py @ 2165:dc2584ba5fbc

merged beta into default branch
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 28 Mar 2012 19:54:16 +0200
parents 82a88013a3fd 50aa7cb78cfe
children 63e58ef80ef1
line wrap: on
line diff
--- a/rhodecode/model/__init__.py	Sat Mar 03 03:41:19 2012 +0200
+++ b/rhodecode/model/__init__.py	Wed Mar 28 19:54:16 2012 +0200
@@ -85,14 +85,14 @@
 
         if isinstance(instance, cls):
             return instance
-        elif isinstance(instance, int) or str(instance).isdigit():
+        elif isinstance(instance, (int, long)) or str(instance).isdigit():
             return cls.get(instance)
         else:
             if instance:
                 if callback is None:
                     raise Exception(
-                        'given object must be int or Instance of %s got %s, '
-                        'no callback provided' % (cls, type(instance))
+                        'given object must be int, long or Instance of %s '
+                        'got %s, no callback provided' % (cls, type(instance))
                     )
                 else:
                     return callback(instance)