@@ -83,6 +83,13 @@ def walk_dedent_tree_node(node, children, force_split_next=False):
if six.text_type(node).startswith("\n"):
if isinstance(node, Leaf):
prev = node.prev_sibling
+ next = node.next_sibling
+
+ if next and six.text_type(next).strip() == ':':
+ return # excape hatch for misidentification of single nested dict item
+ if six.text_type(node).strip() == '}':
+ return # generally yapf does good job positioning closing curlybraces
is_followup = prev and prev.type == token.STRING and node.type == token.STRING
if is_followup:
new_value = node.value
@@ -192,7 +192,10 @@ def merge_threads(request, validated_data, threads, poll):
thread.delete()
record_event(
- request, new_thread, 'merged', {
+ request,
+ new_thread,
+ 'merged',
+ {
'merged_thread': thread.title,
},
commit=False,
@@ -27,7 +27,9 @@ ATTACHMENTS = [
{
'name': 'PDF',
'extensions': ('pdf', ),
- 'mimetypes': ('application/pdf', 'application/x-pdf', 'application/x-bzpdf', 'application/x-gzpdf',),
+ 'mimetypes': (
+ 'application/pdf', 'application/x-pdf', 'application/x-bzpdf', 'application/x-gzpdf',
+ ),
'size_limit': 4 * 1024
@@ -47,8 +47,8 @@ class SearchThreads(SearchProvider):
results = {
'results': FeedSerializer(posts, many=True, context={
- 'user': self.request.user,
- }).data
+ 'user': self.request.user,
+ }).data
}
results.update(paginator)
@@ -82,7 +82,7 @@ class UserAdmin(admin.ModelAdmin):
'fields': (
'username', 'email', 'rank', 'last_login', 'joined_on', 'is_staff',
- 'is_superuser', 'edit_from_misago_link',
+ 'is_superuser', 'edit_from_misago_link',
)
],
@@ -15,12 +15,9 @@ class MisagoAuthMixin(object):
error_messages = {
'empty_data': _("Fill out both fields."),
'invalid_login': _("Login or password is incorrect."),
- 'inactive_user': _(
- "You have to activate your account before you will be able to sign in."
- ),
+ 'inactive_user': _("You have to activate your account before you will be able to sign in."),
'inactive_admin': _(
- "Your account has to be activated by Administrator "
- "before you will be able to sign in."
+ "Your account has to be activated by Administrator before you will be able to sign in."
),
@@ -118,9 +118,7 @@ def create_users_settings_group(apps, schema_editor):
'setting': 'avatar_upload_limit',
'name': _("Maximum size of uploaded avatar"),
- 'description': _(
- "Enter maximum allowed file size (in KB) for avatar uploads."
+ 'description': _("Enter maximum allowed file size (in KB) for avatar uploads."),
'python_type': 'int',
'value': 1536,
'field_extra': {
@@ -104,9 +104,7 @@ def update_users_settings(apps, schema_editor):
'default_value': 1536,
@@ -62,7 +62,9 @@ def activate_by_token(request, pk, token):
})
except ActivationError as e:
return render(
- request, 'misago/activation/error.html', {
+ 'misago/activation/error.html',
'message': e.args[0],
status=400,
@@ -55,8 +55,8 @@ def confirm_email_change(request, token):
request, 'misago/options/credentials_changed.html', {
'message': message % {
- 'user': request.user.username,
- },
+ 'user': request.user.username,
+ },