Skip to content
Snippets Groups Projects
Commit d62ef202 authored by Christian Boltz's avatar Christian Boltz Committed by Ben Adida
Browse files

Use substr() instead of substring() in SQL query

SQLite doesn't know substring() - only substr() works.

In MySQL, MariaDB and PostgreSQL), substring() and substr() do the same.
parent d37ee8c2
No related branches found
No related tags found
No related merge requests found
...@@ -183,7 +183,7 @@ class Election(HeliosModel): ...@@ -183,7 +183,7 @@ class Election(HeliosModel):
if not self.use_voter_aliases: if not self.use_voter_aliases:
return None return None
return utils.one_val_raw_sql("select max(cast(substring(alias, 2) as integer)) from " + Voter._meta.db_table + " where election_id = %s", [self.id]) or 0 return utils.one_val_raw_sql("select max(cast(substr(alias, 2) as integer)) from " + Voter._meta.db_table + " where election_id = %s", [self.id]) or 0
@property @property
def encrypted_tally_hash(self): def encrypted_tally_hash(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment