Skip to content

Commit

Permalink
sqlite does not have truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
aniversarioperu committed Apr 13, 2015
1 parent 271fc9a commit e899d29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions proyectos_de_ley/stats/management/commands/create_stats.py
Expand Up @@ -9,6 +9,7 @@

from django.core.management.base import BaseCommand, CommandError
from django.db import connection
from django.conf import settings

from pdl.models import Seguimientos
from stats.models import ComisionCount
Expand Down Expand Up @@ -86,8 +87,9 @@ def get_with_dictamen_but_not_voted(self):
queryset = Seguimientos.objects.all().order_by('proyecto_id').values('proyecto_id', 'evento')
proyect_ids = self.get_proyect_ids(queryset)

cursor = connection.cursor()
cursor.execute("TRUNCATE TABLE stats_withdictamenbutnotvoted RESTART IDENTITY")
if not settings.TESTING:
cursor = connection.cursor()
cursor.execute("TRUNCATE TABLE stats_withdictamenbutnotvoted RESTART IDENTITY")

projects = []
for proyecto_id in proyect_ids:
Expand Down

0 comments on commit e899d29

Please sign in to comment.