forked from mirrors/bookwyrm
linting fixes
- remove unused imports - add class docstrings
This commit is contained in:
parent
484e9ed959
commit
cc8db1c353
2 changed files with 5 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
""" do book related things with other users """
|
||||
from django.apps import apps
|
||||
from django.db import models, IntegrityError, models, transaction
|
||||
from django.db import models, IntegrityError, transaction
|
||||
from django.db.models import Q
|
||||
from bookwyrm.settings import DOMAIN
|
||||
from .base_model import BookWyrmModel
|
||||
|
@ -36,6 +36,7 @@ class GroupMember(models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
"""Users can only have one membership per group"""
|
||||
constraints = [
|
||||
models.UniqueConstraint(fields=["group", "user"], name="unique_membership")
|
||||
]
|
||||
|
@ -83,6 +84,7 @@ class GroupMemberInvitation(models.Model):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
"""Users can only have one outstanding invitation per group"""
|
||||
constraints = [
|
||||
models.UniqueConstraint(fields=["group", "user"], name="unique_invitation")
|
||||
]
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
""" make a list of books!! """
|
||||
from bookwyrm.models.group import GroupMember
|
||||
from dataclasses import field
|
||||
from django.apps import apps
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
from bookwyrm import activitypub
|
||||
from bookwyrm.settings import DOMAIN
|
||||
|
||||
from .activitypub_mixin import CollectionItemMixin, OrderedCollectionMixin
|
||||
from .base_model import BookWyrmModel
|
||||
from . import fields
|
||||
from .group import GroupMember
|
||||
from . import fields
|
||||
|
||||
CurationType = models.TextChoices(
|
||||
"Curation",
|
||||
|
|
Loading…
Reference in a new issue