-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 232_implement_ftp_retry
- Loading branch information
Showing
23 changed files
with
292 additions
and
225 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
from django.core.management.base import BaseCommand | ||
from app.management.commands.base.params import BaseParamsUI | ||
from app.models import Winner | ||
from app.models import Vendor | ||
|
||
|
||
class Command(BaseCommand, BaseParamsUI): | ||
help = 'Removes unnecessary newlines from award vendors name' | ||
|
||
def handle(self, *args, **options): | ||
winners = Winner.objects.all() | ||
vendors = Vendor.objects.all() | ||
|
||
for winner in winners: | ||
winner.vendor = winner.vendor.strip() | ||
winner.save() | ||
for vendor in vendors: | ||
vendor.name = vendor.name.strip() | ||
vendor.save() | ||
|
||
self.stdout.write(self.style.SUCCESS('Removed unnecessary new lines')) | ||
return 'Removed unnecessary new lines' |
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,31 @@ | ||
# Generated by Django 2.2.4 on 2019-10-07 15:07 | ||
|
||
from django.db import migrations, models | ||
|
||
def move_vendors_link(apps, schema_editor): | ||
vendor_model = apps.get_model('app', 'Vendor') | ||
winner_model = apps.get_model('app', 'Winner') | ||
for winner in winner_model.objects.all(): | ||
vendor = winner.vendor | ||
winner.vendors.add(vendor) | ||
winner.save() | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('app', '0024_split_winner_vendor'), | ||
] | ||
|
||
operations = [ | ||
|
||
migrations.RunPython(move_vendors_link), | ||
migrations.RemoveField( | ||
model_name='winner', | ||
name='vendor', | ||
), | ||
migrations.AddField( | ||
model_name='winner', | ||
name='vendors', | ||
field=models.ManyToManyField(related_name='winners', to='app.Vendor'), | ||
), | ||
] |
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
Oops, something went wrong.