mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-20 08:31:07 +00:00
Merge pull request #520 from cincodenada/fix-migration-0035
Fix error in migrations
This commit is contained in:
commit
cda53cc919
2 changed files with 1 additions and 3 deletions
|
@ -8,7 +8,6 @@ def set_rank(app_registry, schema_editor):
|
|||
db_alias = schema_editor.connection.alias
|
||||
books = app_registry.get_model('bookwyrm', 'Edition')
|
||||
for book in books.objects.using(db_alias):
|
||||
book.edition_rank = book.get_rank
|
||||
book.save()
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
@ -178,7 +178,6 @@ class Edition(Book):
|
|||
activity_serializer = activitypub.Edition
|
||||
name_field = 'title'
|
||||
|
||||
@property
|
||||
def get_rank(self):
|
||||
''' calculate how complete the data is on this edition '''
|
||||
if self.parent_work and self.parent_work.default_edition == self:
|
||||
|
@ -204,7 +203,7 @@ class Edition(Book):
|
|||
self.isbn_13 = isbn_10_to_13(self.isbn_10)
|
||||
|
||||
# set rank
|
||||
self.edition_rank = self.get_rank
|
||||
self.edition_rank = self.get_rank()
|
||||
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
|
|
Loading…
Reference in a new issue