Skip to content

Commit

Permalink
Merge pull request #2156 from SFDO-Tooling/revert-2154-update-deps-py…
Browse files Browse the repository at this point in the history
…thon

Revert "@W-14603959 - Update backend deps and test failure fixes"
  • Loading branch information
vsbharath authored Dec 20, 2023
2 parents c12b902 + ba83a02 commit 24ebbaf
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 243 deletions.
1 change: 0 additions & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def safe_key() -> str:
MIDDLEWARE = [
"metecho.logging_middleware.LoggingMiddleware",
"sfdo_template_helpers.admin.middleware.AdminRestrictMiddleware",
"allauth.account.middleware.AccountMiddleware",
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
Expand Down
20 changes: 0 additions & 20 deletions docs/api/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1871,11 +1871,6 @@ components:
- Review
- Merged
type: string
description: |-
* `Planned` - Planned
* `In progress` - In Progress
* `Review` - Review
* `Merged` - Merged
FullUser:
type: object
properties:
Expand Down Expand Up @@ -2123,10 +2118,6 @@ components:
- QA
- Playground
type: string
description: |-
* `Dev` - Dev
* `QA` - QA
* `Playground` - Playground
PaginatedEpicList:
type: object
properties:
Expand Down Expand Up @@ -2490,17 +2481,11 @@ components:
- Approved
- Changes requested
type: string
description: |-
* `Approved` - Approved
* `Changes requested` - Changes Requested
RoleEnum:
enum:
- assigned_qa
- assigned_dev
type: string
description: |-
* `assigned_qa` - assigned_qa
* `assigned_dev` - assigned_dev
ScratchOrg:
type: object
properties:
Expand Down Expand Up @@ -2924,11 +2909,6 @@ components:
- Completed
- Canceled
type: string
description: |-
* `Planned` - Planned
* `In progress` - In Progress
* `Completed` - Completed
* `Canceled` - Canceled
securitySchemes:
cookieAuth:
type: apiKey
Expand Down
4 changes: 1 addition & 3 deletions metecho/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,8 @@ def __str__(self):
return self.name

def save(self, *args, **kwargs):
if not self.id:
super().save(*args, **kwargs)
self.update_status()
return super().save()
return super().save(*args, **kwargs)

def subscribable_by(self, user): # pragma: nocover
return True
Expand Down
19 changes: 4 additions & 15 deletions metecho/oauth2/salesforce/tests/provider.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
from ..provider import CustomSalesforceProvider
import pytest


@pytest.mark.django_db
def test_get_auth_params(rf, social_app_factory):
def test_get_auth_params(rf):
request = rf.get("/")
app = social_app_factory(
name=CustomSalesforceProvider.id,
provider=CustomSalesforceProvider.id,
)
result = CustomSalesforceProvider(request, app).get_auth_params(request, None)
result = CustomSalesforceProvider(request).get_auth_params(request, None)
assert "prompt" in result and result["prompt"] == "login"


@pytest.mark.django_db
def test_extract_uid(rf, social_app_factory):
def test_extract_uid(rf):
request = rf.get("/")
app = social_app_factory(
name=CustomSalesforceProvider.id,
provider=CustomSalesforceProvider.id,
)
provider = CustomSalesforceProvider(request, app)
provider = CustomSalesforceProvider(request)
result = provider.extract_uid({"organization_id": "ORG", "user_id": "USER"})
assert result == "ORG/USER"
2 changes: 1 addition & 1 deletion metecho/oauth2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def ensure_socialapp_in_db(token):
unless we create them here.
"""
if token.app.pk is None:
provider = providers.registry.get_class(token.app.provider)
provider = providers.registry.by_id(token.app.provider)
app, created = SocialApp.objects.get_or_create(
provider=provider.id,
name=provider.name,
Expand Down
Loading

0 comments on commit 24ebbaf

Please sign in to comment.