Skip to content
Snippets Groups Projects
Verified Commit 73ee587d authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

swh/deposit/migrations/0021: Fix migration script

Prior to this commit, running this script would not work when actually
triggered on a db with data:

```
swhdeposit@deposit:~$ django-admin migrate --settings=swh.deposit.settings.production
Operations to perform:
  Apply all migrations: auth, contenttypes, deposit, sessions
Running migrations:
  Applying deposit.0021_deposit_origin_url_20201124_1438...Traceback (most recent call last):
...
TypeError: guess_deposit_origin_url() missing 1 required positional argument: 'deposit'
```
parent c436adcf
1 merge request!191swh/deposit/migrations/0021: Fix migration script
......@@ -7,7 +7,7 @@ from swh.deposit.models import Deposit
def fill_origin_url(apps, schema_editor):
for deposit in Deposit.objects.all():
if deposit.origin_url is None:
deposit.origin_url = guess_deposit_origin_url()
deposit.origin_url = guess_deposit_origin_url(deposit)
deposit.save()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment