X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fpatchwork%2Fmodels.py;h=11457d76bdf9a0e14524b425dbc483b41d8f083c;hb=7451e16588d2de6bce18fcc60b3be654ee591ac1;hp=6d331f325785b4ef0eebeb1a65eac0b12c3e7e2e;hpb=05d26756d7e7f254d5631a0649aeac5fd3a58ca8;p=patchwork diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py index 6d331f3..11457d7 100644 --- a/apps/patchwork/models.py +++ b/apps/patchwork/models.py @@ -194,10 +194,13 @@ class HashField(models.Field): n_bytes = len(hashlib.new(self.algorithm).digest()) else: n_bytes = len(self.hash_constructor().digest()) - if settings.DATABASE_ENGINE == 'postgresql': + if settings.DATABASE_ENGINE.startswith('postgresql'): return 'bytea' elif settings.DATABASE_ENGINE == 'mysql': return 'binary(%d)' % n_bytes + else: + raise Exception("Unknown database engine '%s'" % \ + settings.DATABASE_ENGINE) def to_python(self, value): return value