linting fixes
- remove unused imports - add class docstrings
This commit is contained in:
@ -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")
|
||||
]
|
||||
|
Reference in New Issue
Block a user