Skip to content

Commit

Permalink
Fix two python migrations for outdoor
Browse files Browse the repository at this point in the history
  • Loading branch information
babastienne committed Oct 5, 2021
1 parent 4f89e84 commit 7149409
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions geotrek/outdoor/migrations/0025_merge_ratings_min_max.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Generated by Célia 23.8 on 2021-09-15 15:12

from django.apps import apps

from django.db import migrations


def merge_ratings_min_max(app, schema):
def merge_ratings_min_max(apps, schema):
site_model = apps.get_model('outdoor', 'Site')
sites = site_model.objects.all()
for site in sites:
Expand Down
6 changes: 2 additions & 4 deletions geotrek/outdoor/migrations/0027_merge_ratings.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Generated by Célia 23.8 on 2021-09-15 15:12

from django.apps import apps

from django.db import migrations


def merge_ratings(app, schema):
def merge_ratings(apps, schema):
site_model = apps.get_model('outdoor', 'Site')
sites = site_model.objects.all()
for site in sites:
Expand All @@ -15,7 +13,7 @@ def merge_ratings(app, schema):
site.ratings_min.clear()


def reverse_merge_ratings(app, schema):
def reverse_merge_ratings(apps, schema):
site_model = apps.get_model('outdoor', 'Site')
sites = site_model.objects.all()
for site in sites:
Expand Down

0 comments on commit 7149409

Please sign in to comment.