fix to pass invite request pytest

This commit is contained in:
corentin-feys 2022-03-13 23:34:49 +01:00
parent 74a1697cda
commit a0ae96923c
4 changed files with 31 additions and 53 deletions

View file

@ -1,29 +0,0 @@
# Generated by Django 3.2.12 on 2022-03-12 10:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookwyrm', '0144_alter_announcement_display_type'),
]
operations = [
migrations.AddField(
model_name='inviterequest',
name='answer',
field=models.TextField(default='Foundation by Isaac Azimov', max_length=50),
preserve_default=False,
),
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),
),
]

View file

@ -0,0 +1,30 @@
# Generated by Django 3.2.12 on 2022-03-13 22:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0144_alter_announcement_display_type"),
]
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),
),
]

View file

@ -1,23 +0,0 @@
# Generated by Django 3.2.12 on 2022-03-11 15:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0145_auto_20220307_2025"),
]
operations = [
migrations.AlterField(
model_name="sitesettings",
name="invite_question_text",
field=models.CharField(
blank=True,
default="What is your favourite book?",
max_length=255,
null=True,
),
),
]

View file

@ -155,7 +155,7 @@ class InviteRequest(BookWyrmModel):
invite = models.ForeignKey(
SiteInvite, on_delete=models.SET_NULL, null=True, blank=True
)
answer = models.TextField(max_length=50, unique=False, null=False)
answer = models.TextField(max_length=50, unique=False, null=True, blank=True)
invite_sent = models.BooleanField(default=False)
ignored = models.BooleanField(default=False)