Skip to content

Commit

Permalink
Address line lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
bennylope committed Nov 23, 2023
1 parent b0b3b54 commit 546062a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/organizations/backends/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def email_message(
):
"""
Returns an email message for a new user. This can be easily overridden.
For instance, to send an HTML message, use the EmailMultiAlternatives message_class
and attach the additional conent.
For instance, to send an HTML message, use the EmailMultiAlternatives
message_class and attach the additional conent.
"""
if sender:
try:
Expand Down
11 changes: 7 additions & 4 deletions src/organizations/backends/modeled.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ class ModelInvitation(InvitationBackend):

def __init__(self, org_model=None, namespace=None):
super().__init__(org_model=org_model, namespace=namespace)
self.invitation_model = self.org_model.invitation_model # type: OrganizationInvitationBase
self.invitation_model = self.org_model.invitation_model # type: OrganizationInvitationBase # noqa: E501

def get_invitation_queryset(self):
"""Return this to use a custom queryset that checks for expiration, for example"""
"""Return available invitations.
Use a custom queryset that checks for expiration, for example.
"""
return self.invitation_model.objects.all()

def get_invitation_accepted_url(self):
Expand Down Expand Up @@ -168,8 +171,8 @@ def email_message(
):
"""
Returns an invitation email message. This can be easily overridden.
For instance, to send an HTML message, use the EmailMultiAlternatives message_class
and attach the additional conent.
For instance, to send an HTML message, use the EmailMultiAlternatives
message_class and attach the additional conent.
"""
from_email = "%s %s <%s>" % (
sender.first_name,
Expand Down
3 changes: 2 additions & 1 deletion src/organizations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ class AbstractBaseInvitation(models.Model):
invitee_identifier = models.CharField(
max_length=1000,
help_text=_(
"The contact identifier for the invitee, email, phone number, social media handle, etc."
"The contact identifier for the invitee, email, phone number,"
" social media handle, etc."
),
)

Expand Down
4 changes: 3 additions & 1 deletion src/organizations/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class Migration(migrations.Migration):
"slug",
organizations.fields.SlugField(
editable=True,
help_text="The name in all lowercase, suitable for URL identification",
help_text=(
"The name in all lowercase, suitable for URL identification"
),
max_length=200,
populate_from="name",
unique=True,
Expand Down
5 changes: 4 additions & 1 deletion src/organizations/migrations/0004_organizationinvitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ class Migration(migrations.Migration):
(
"invitee_identifier",
models.CharField(
help_text="The contact identifier for the invitee, email, phone number, social media handle, etc.",
help_text=(
"The contact identifier for the invitee, email, "
"phone number, social media handle, etc."
),
max_length=1000,
),
),
Expand Down

0 comments on commit 546062a

Please sign in to comment.