Updates code for linter
This commit is contained in:
@ -93,7 +93,8 @@ class ListItem(CollectionItemMixin, BookWyrmModel):
|
||||
)
|
||||
|
||||
class Meta:
|
||||
# A book may only be placed into a list once, and each order in the list may be used only
|
||||
# once
|
||||
"""A book may only be placed into a list once,
|
||||
and each order in the list may be used only once"""
|
||||
|
||||
unique_together = (("book", "book_list"), ("order", "book_list"))
|
||||
ordering = ("-created_date",)
|
||||
|
@ -232,7 +232,7 @@ class User(OrderedCollectionPageMixin, AbstractUser):
|
||||
def save(self, *args, **kwargs):
|
||||
"""populate fields for new local users"""
|
||||
created = not bool(self.id)
|
||||
if not self.local and not re.match(regex.full_username, self.username):
|
||||
if not self.local and not re.match(regex.FULL_USERNAME, self.username):
|
||||
# generate a username that uses the domain (webfinger format)
|
||||
actor_parts = urlparse(self.remote_id)
|
||||
self.username = "%s@%s" % (self.username, actor_parts.netloc)
|
||||
|
Reference in New Issue
Block a user