Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black all the things! #1136

Merged
merged 2 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cypress/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def main():
continue
else:
# recieved not 200 from PostHog, but service is up
print("Found status %d" % (r.status, ))
with open('cypress/screenshots/curl.html', 'wb') as f:
print("Found status %d" % (r.status,))
with open("cypress/screenshots/curl.html", "wb") as f:
f.write(r.read)
print("PostHog is still booting. Sleeping for 1 second")
except:
Expand Down
15 changes: 8 additions & 7 deletions gunicorn.config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

loglevel = "error"

def on_starting(server):
print("""
\x1b[1;34m""" +

r"""
def on_starting(server):
print(
"""
\x1b[1;34m"""
+ r"""
_____ _ _ _
| __ \ | | | | | |
| |__) |__ ___| |_| |__| | ___ __ _
Expand All @@ -17,11 +18,11 @@ def on_starting(server):
|_| \___/|___/\__|_| |_|\___/ \__, |
__/ |
|___/
""" +

"""
+ """
\x1b[0m
""")
"""
)
print("Server running on \x1b[4mhttp://{}:{}\x1b[0m".format(*server.address[0]))
print("Questions? Please shoot us an email at \x1b[4mhey@posthog.com\x1b[0m")
print("\nTo stop, press CTRL + C")
4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'posthog.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "posthog.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand All @@ -17,5 +17,5 @@ def main():
execute_from_command_line(sys.argv)


if __name__ == '__main__':
if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"lint-staged": {
"*.{js,css,scss}": "prettier --write",
"*.js": "eslint",
"*.py": "black"
"*.py": "black -l 120"
},
"optionalDependencies": {
"fsevents": "^2.1.2"
Expand Down
2 changes: 1 addition & 1 deletion posthog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Django starts so that shared_task will use this app.
from posthog.celery import app as celery_app

__all__ = ('celery_app',)
__all__ = ("celery_app",)
17 changes: 2 additions & 15 deletions posthog/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,11 @@ class UserAdmin(DjangoUserAdmin):
fieldsets = (
(None, {"fields": ("email", "password")}),
(_("Personal info"), {"fields": ("first_name", "last_name")}),
(
_("Permissions"),
{
"fields": (
"is_active",
"is_staff",
"is_superuser",
"groups",
"user_permissions",
)
},
),
(_("Permissions"), {"fields": ("is_active", "is_staff", "is_superuser", "groups", "user_permissions",)},),
(_("Important dates"), {"fields": ("last_login", "date_joined")}),
(_("PostHog"), {"fields": ("temporary_token",)}),
)
add_fieldsets = (
(None, {"classes": ("wide",), "fields": ("email", "password1", "password2"),}),
)
add_fieldsets = ((None, {"classes": ("wide",), "fields": ("email", "password1", "password2"),}),)
list_display = ("email", "first_name", "last_name", "is_staff")
search_fields = ("email", "first_name", "last_name")
ordering = ("email",)
Loading