forked from mirrors/bookwyrm
Merge pull request #533 from mouse-reeve/fixes-email
Fixes email migration
This commit is contained in:
commit
ba536270d6
3 changed files with 4 additions and 20 deletions
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 3.0.7 on 2021-01-18 19:00
|
||||
# Generated by Django 3.0.7 on 2021-01-18 19:54
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
@ -17,6 +17,6 @@ class Migration(migrations.Migration):
|
|||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='email',
|
||||
field=models.EmailField(max_length=254, unique=True),
|
||||
field=models.EmailField(max_length=254, null=True, unique=True),
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 3.0.7 on 2021-01-18 19:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bookwyrm', '0037_auto_20210118_1900'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='email',
|
||||
field=models.EmailField(max_length=254, null=True, unique=True),
|
||||
),
|
||||
]
|
|
@ -36,6 +36,8 @@ def is_bookworm_request(request):
|
|||
|
||||
def object_visible_to_user(viewer, obj):
|
||||
''' is a user authorized to view an object? '''
|
||||
if not obj:
|
||||
return False
|
||||
if viewer == obj.user or obj.privacy in ['public', 'unlisted']:
|
||||
return True
|
||||
if obj.privacy == 'followers' and \
|
||||
|
|
Loading…
Reference in a new issue