-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #390 from Cadasta/bugs/email-subject
Fixes #387: new command to replace default site object
- Loading branch information
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.core.management.base import BaseCommand | ||
|
||
from core.management.commands import loadfixtures, loadsite | ||
from accounts.management.commands import loadpolicies | ||
from geography.management.commands import loadcountries | ||
|
||
|
||
class Command(BaseCommand): | ||
help = """Load in all site, country, policy and test data.""" | ||
|
||
def handle(self, *args, **options): | ||
loadsite.Command().handle() | ||
loadcountries.Command().handle() | ||
loadpolicies.Command().handle() | ||
loadfixtures.Command().handle(delete=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.core.management.base import BaseCommand | ||
from django.contrib.sites.models import Site | ||
|
||
|
||
class Command(BaseCommand): | ||
help = """Loads initial site object for Cadasta.org.""" | ||
|
||
def handle(self, *args, **options): | ||
if not Site.objects.filter(name='Cadasta').exists(): | ||
site = Site.objects.get(name='example.com') | ||
site.name = 'Cadasta' | ||
site.domain = 'platform.cadasta.org' | ||
site.save() | ||
return "Successfully loaded Cadasta.org object" | ||
else: | ||
return "Cadasta.org object already exists." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters