-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow bookmarks to have empty title and description (#843)
* add migration for merging fields * remove usage of website title and description * keep empty website title and description in API for compatibility * restore scraping in API and add option for disabling it * document API scraping behavior * remove deprecated fields from API docs * improve form layout * cleanup migration * cleanup website loader * update tests
- Loading branch information
1 parent
afa57aa
commit fe7ddbe
Showing
22 changed files
with
406 additions
and
361 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Generated by Django 5.1.1 on 2024-09-21 08:13 | ||
|
||
from django.db import migrations | ||
from django.db.models import Q | ||
from django.db.models.expressions import RawSQL | ||
|
||
from bookmarks.models import Bookmark | ||
|
||
|
||
def forwards(apps, schema_editor): | ||
Bookmark.objects.filter( | ||
Q(title__isnull=True) | Q(title__exact=""), | ||
).extra( | ||
where=["website_title IS NOT NULL"] | ||
).update(title=RawSQL("website_title", ())) | ||
|
||
Bookmark.objects.filter( | ||
Q(description__isnull=True) | Q(description__exact=""), | ||
).extra(where=["website_description IS NOT NULL"]).update( | ||
description=RawSQL("website_description", ()) | ||
) | ||
|
||
|
||
def reverse(apps, schema_editor): | ||
pass | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("bookmarks", "0040_userprofile_items_per_page_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forwards, reverse), | ||
] |
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.