Skip to content

Commit

Permalink
[rbdemo] Delete the SCMTools prior to loading in fixtures.
Browse files Browse the repository at this point in the history
It was easy to get into a situation where SCMTools from the fixtures
conflicted with what was populated from registerscmtools. We now clear
out the SCMTools in the database immediately before we load the fixture
data.

Testing Done:
This fixed a problem I had on demo.reviewboard.org with deploying updates
to the fixtures.

Reviewed at https://reviews.reviewboard.org/r/7138/
  • Loading branch information
chipx86 committed Apr 4, 2015
1 parent 987e368 commit 6981472
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rbdemo/rbdemo/management/commands/reset-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from reviewboard.diffviewer.models import DiffSet
from reviewboard.reviews.models import (Comment, FileAttachmentComment,
ReviewRequest, Review)
from reviewboard.scmtools.models import Tool


class Command(NoArgsCommand):
Expand Down Expand Up @@ -87,6 +88,7 @@ def handle_noargs(self, **options):
# Reset the state of the database.
execute_from_command_line([cmd, 'flush', '--noinput',
'--no-initial-data'])
Tool.objects.all().delete()

# Now load in the new fixtures.
execute_from_command_line([cmd, 'loaddata'] + demo_fixtures)
Expand Down

0 comments on commit 6981472

Please sign in to comment.