Skip to content

Commit

Permalink
@W-14870747 - Fixing sorts and black issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vsbharath committed Feb 6, 2024
1 parent 6c4b58b commit 7689ac4
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 23 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Expand Up @@ -56,7 +56,8 @@ Use the "Webhook secret" value as your `GITHUB_HOOK_SECRET` environment variable
in Metecho.

Use the app's "App ID" as `GITHUB_APP_ID`, "Client ID" as `GITHUB_CLIENT_ID`,
and "Client secret" as `GITHUB_CLIENT_SECRET`. These are stored in a shared lastpass note.
and "Client secret" as `GITHUB_CLIENT_SECRET`. These are stored in a shared
lastpass note.

Finally, generate a new private key for the app and set it as the
`GITHUB_APP_KEY` environment variable (the entire key, not a path to one). If
Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -4,7 +4,8 @@

## Development and Deployment

See [documentation](https://metecho.readthedocs.io/en/latest/heroku-setup.html) on how to set up Metecho on Heroku.
See [documentation](https://metecho.readthedocs.io/en/latest/heroku-setup.html)
on how to set up Metecho on Heroku.

See [CONTRIBUTING.md](CONTRIBUTING.md).

Expand Down
2 changes: 1 addition & 1 deletion metecho/api/gh.py
Expand Up @@ -9,9 +9,9 @@
import os
import pathlib
import shutil
from typing import Generator
import zipfile
from glob import glob
from typing import Generator

from cumulusci.utils import temporary_dir
from django.conf import settings
Expand Down
5 changes: 3 additions & 2 deletions metecho/api/jobs.py
Expand Up @@ -273,8 +273,9 @@ def create_repository(

else:
repo = org.create_repository(
project.repo_name, description=project.description,
private=settings.ENABLE_CREATE_PRIVATE_REPO
project.repo_name,
description=project.description,
private=settings.ENABLE_CREATE_PRIVATE_REPO,
)
team.add_repository(repo.full_name, permission="push")
project.repo_id = repo.id
Expand Down
6 changes: 3 additions & 3 deletions metecho/api/migrations/0118_project_deleted_at.py
Expand Up @@ -6,13 +6,13 @@
class Migration(migrations.Migration):

dependencies = [
('api', '0117_scratchorg_installed_packages'),
("api", "0117_scratchorg_installed_packages"),
]

operations = [
migrations.AddField(
model_name='project',
name='deleted_at',
model_name="project",
name="deleted_at",
field=models.DateTimeField(blank=True, null=True),
),
]
5 changes: 2 additions & 3 deletions metecho/api/models.py
Expand Up @@ -11,7 +11,7 @@
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.models import UserManager as BaseUserManager
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError, MultipleObjectsReturned
from django.core.exceptions import MultipleObjectsReturned, ValidationError
from django.core.mail import send_mail
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models, transaction
Expand Down Expand Up @@ -241,10 +241,9 @@ def avatar_url(self) -> Optional[str]:
except (AttributeError, KeyError, TypeError):
return None
# if social app exists in both db and settings retrun sample url
except (MultipleObjectsReturned):
except MultipleObjectsReturned:
return "https://example.com/avatar/"


@property
def org_id(self) -> Optional[str]:
try:
Expand Down
1 change: 1 addition & 0 deletions metecho/api/push.py
Expand Up @@ -63,6 +63,7 @@
scratchorg.list
SCRATCH_ORG_RECREATE
"""

from copy import deepcopy
from typing import TYPE_CHECKING, Optional

Expand Down
6 changes: 3 additions & 3 deletions metecho/api/tests/serializers.py
Expand Up @@ -880,9 +880,9 @@ def test_assign__scratch_org_transfer(
_ = user_factory(
socialaccount_set__provider="github",
socialaccount_set__uid=GH_WITH_METECHO_ID,
devhub_username=FIRST_DEVHUB_USER
if target_has_same_dev_hub
else SECOND_DEVHUB_USER,
devhub_username=(
FIRST_DEVHUB_USER if target_has_same_dev_hub else SECOND_DEVHUB_USER
),
)
target_gh_with_user = git_hub_user_factory(id=GH_WITH_METECHO_ID)

Expand Down
1 change: 0 additions & 1 deletion metecho/oauth2/github/tests/views.py
@@ -1,7 +1,6 @@
from unittest import mock

import pytest
from allauth.socialaccount.models import SocialApp

from ..views import CustomGitHubOAuth2Adapter

Expand Down
5 changes: 1 addition & 4 deletions metecho/oauth2/github/views.py
@@ -1,9 +1,6 @@
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter

from ..views import (
LoggingOAuth2CallbackView,
LoggingOAuth2LoginView,
)
from ..views import LoggingOAuth2CallbackView, LoggingOAuth2LoginView


class CustomGitHubOAuth2Adapter(GitHubOAuth2Adapter):
Expand Down
1 change: 1 addition & 0 deletions metecho/oauth2/salesforce/tests/provider.py
@@ -1,4 +1,5 @@
import pytest

from ..provider import CustomSalesforceProvider


Expand Down
5 changes: 1 addition & 4 deletions metecho/oauth2/salesforce/views.py
Expand Up @@ -10,10 +10,7 @@

from metecho.api.constants import ORGANIZATION_DETAILS

from ..views import (
LoggingOAuth2CallbackView,
LoggingOAuth2LoginView,
)
from ..views import LoggingOAuth2CallbackView, LoggingOAuth2LoginView

logger = logging.getLogger(__name__)
ORGID_RE = re.compile(r"^00D[a-zA-Z0-9]{15}$")
Expand Down
1 change: 1 addition & 0 deletions metecho/urls.py
Expand Up @@ -13,6 +13,7 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""

from urllib.parse import urljoin

from django.conf import settings
Expand Down

0 comments on commit 7689ac4

Please sign in to comment.