-
-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
3,139 additions
and
2,025 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ def clean(self): | |
|
||
class Meta: | ||
model = models.InviteRequest | ||
fields = ["email"] | ||
fields = ["email", "answer"] |
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,54 @@ | ||
""" Get your admin code to allow install """ | ||
from django.core.management.base import BaseCommand | ||
|
||
from bookwyrm import models | ||
from bookwyrm.settings import VERSION | ||
|
||
|
||
# pylint: disable=no-self-use | ||
class Command(BaseCommand): | ||
"""command-line options""" | ||
|
||
help = "What version is this?" | ||
|
||
def add_arguments(self, parser): | ||
"""specify which function to run""" | ||
parser.add_argument( | ||
"--current", | ||
action="store_true", | ||
help="Version stored in database", | ||
) | ||
parser.add_argument( | ||
"--target", | ||
action="store_true", | ||
help="Version stored in settings", | ||
) | ||
parser.add_argument( | ||
"--update", | ||
action="store_true", | ||
help="Update database version", | ||
) | ||
|
||
# pylint: disable=unused-argument | ||
def handle(self, *args, **options): | ||
"""execute init""" | ||
site = models.SiteSettings.objects.get() | ||
current = site.version or "0.0.1" | ||
target = VERSION | ||
if options.get("current"): | ||
print(current) | ||
return | ||
|
||
if options.get("target"): | ||
print(target) | ||
return | ||
|
||
if options.get("update"): | ||
site.version = target | ||
site.save() | ||
return | ||
|
||
if current != target: | ||
print(f"{current}/{target}") | ||
else: | ||
print(current) |
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,18 @@ | ||
# Generated by Django 3.2.12 on 2022-03-16 18:10 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("bookwyrm", "0144_alter_announcement_display_type"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="sitesettings", | ||
name="version", | ||
field=models.CharField(blank=True, max_length=10, null=True), | ||
), | ||
] |
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,30 @@ | ||
# Generated by Django 3.2.12 on 2022-03-16 23:52 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("bookwyrm", "0145_sitesettings_version"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="inviterequest", | ||
name="answer", | ||
field=models.TextField(blank=True, max_length=50, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="sitesettings", | ||
name="invite_question_text", | ||
field=models.CharField( | ||
blank=True, default="What is your favourite book?", max_length=255 | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="sitesettings", | ||
name="invite_request_question", | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
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
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
Oops, something went wrong.