wbintegrator_office365 1.55.8__tar.gz → 1.55.10rc0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/PKG-INFO +1 -1
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/importer/api.py +5 -5
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/models/event.py +2 -2
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/models/subscription.py +1 -1
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tests/test_admin.py +1 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tests/test_models.py +1 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tests/test_tasks.py +1 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tests/test_views.py +2 -1
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/viewsets/viewsets.py +1 -1
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/.gitignore +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/pyproject.toml +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/admin.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/apps.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/configurations/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/configurations/configurations/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/dynamic_preferences_registry.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/factories.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/filters.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/importer/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/importer/disable_signals.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/importer/parser.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/kpi_handlers/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/kpi_handlers/calls.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/migrations/0001_initial_squashed_squashed_0003_alter_calendar_owner_alter_calendarevent_organizer_and_more.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/migrations/0002_remove_calendar_owner_remove_calendarevent_activity_and_more.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/migrations/0003_alter_event_options.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/migrations/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/models/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/models/tenant.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/serializers.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tasks.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/templates/admin/tenant_change_list.html +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tests/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tests/conftest.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tests/tests.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/urls.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/viewsets/__init__.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/viewsets/display.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/viewsets/endpoints.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/viewsets/menu.py +0 -0
- {wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/viewsets/titles.py +0 -0
@@ -22,7 +22,7 @@ class MicrosoftGraphAPI:
|
|
22
22
|
self.graph_url = getattr(settings, "WBINTEGRATOR_OFFICE365_GRAPH_URL", "")
|
23
23
|
|
24
24
|
global_preferences = global_preferences_registry.manager()
|
25
|
-
if global_preferences["wbintegrator_office365__access_token"] == "0":
|
25
|
+
if global_preferences["wbintegrator_office365__access_token"] == "0": # noqa
|
26
26
|
global_preferences["wbintegrator_office365__access_token"] = self._get_access_token()
|
27
27
|
|
28
28
|
def _get_administrator_consent(self):
|
@@ -385,13 +385,13 @@ class MicrosoftGraphAPI:
|
|
385
385
|
global_preferences = global_preferences_registry.manager()
|
386
386
|
headers["Authorization"] = f'Bearer {global_preferences["wbintegrator_office365__access_token"]}'
|
387
387
|
if method == "POST":
|
388
|
-
response = requests.post(url, data=data, headers=headers)
|
388
|
+
response = requests.post(url, data=data, headers=headers, timeout=10)
|
389
389
|
elif method == "DELETE":
|
390
|
-
response = requests.delete(url, headers=headers)
|
390
|
+
response = requests.delete(url, headers=headers, timeout=10)
|
391
391
|
elif method == "PATCH":
|
392
|
-
response = requests.patch(url, data=data, headers=headers)
|
392
|
+
response = requests.patch(url, data=data, headers=headers, timeout=10)
|
393
393
|
else:
|
394
|
-
response = requests.get(url, headers=headers, params=params)
|
394
|
+
response = requests.get(url, headers=headers, params=params, timeout=10)
|
395
395
|
if response.status_code == status.HTTP_401_UNAUTHORIZED:
|
396
396
|
new_token = self._get_access_token()
|
397
397
|
if new_token != global_preferences["wbintegrator_office365__access_token"]:
|
@@ -94,7 +94,7 @@ class Event(WBModel):
|
|
94
94
|
)
|
95
95
|
|
96
96
|
@classmethod
|
97
|
-
def get_endpoint_basename(
|
97
|
+
def get_endpoint_basename(cls):
|
98
98
|
return "wbintegrator_office365:event"
|
99
99
|
|
100
100
|
@classmethod
|
@@ -254,7 +254,7 @@ class EventLog(WBModel):
|
|
254
254
|
data = models.JSONField(default=dict, null=True, blank=True)
|
255
255
|
|
256
256
|
@classmethod
|
257
|
-
def get_endpoint_basename(
|
257
|
+
def get_endpoint_basename(cls):
|
258
258
|
return "wbintegrator_office365:eventlog"
|
259
259
|
|
260
260
|
@classmethod
|
@@ -6,6 +6,7 @@ from django.contrib.messages import get_messages, storage
|
|
6
6
|
from rest_framework import status
|
7
7
|
from rest_framework.test import APIRequestFactory
|
8
8
|
from wbcore.test.utils import get_or_create_superuser
|
9
|
+
|
9
10
|
from wbintegrator_office365.admin import SubscriptionAdmin, TenantUserAdmin
|
10
11
|
from wbintegrator_office365.factories import TenantUserFactory
|
11
12
|
from wbintegrator_office365.models import Subscription, TenantUser
|
@@ -6,6 +6,7 @@ import phonenumbers
|
|
6
6
|
import pytest
|
7
7
|
from rest_framework import status
|
8
8
|
from wbcore.contrib.directory.factories import TelephoneContactFactory
|
9
|
+
|
9
10
|
from wbintegrator_office365.factories import SubscriptionFactory, TenantUserFactory
|
10
11
|
from wbintegrator_office365.importer import parse
|
11
12
|
from wbintegrator_office365.models import CallEvent, Subscription
|
@@ -7,6 +7,7 @@ from rest_framework.test import APIRequestFactory
|
|
7
7
|
from wbcore.contrib.authentication.factories import InternalUserFactory
|
8
8
|
from wbcore.test.utils import get_or_create_superuser
|
9
9
|
from wbhuman_resources.factories import EmployeeHumanResourceFactory
|
10
|
+
|
10
11
|
from wbintegrator_office365.factories import CallEventFactory, CallUserFactory
|
11
12
|
from wbintegrator_office365.viewsets.viewsets import (
|
12
13
|
CallEventReceptionTime,
|
@@ -63,7 +64,7 @@ class TestView:
|
|
63
64
|
)
|
64
65
|
@patch("wbintegrator_office365.importer.MicrosoftGraphAPI._get_access_token")
|
65
66
|
@patch("wbintegrator_office365.importer.MicrosoftGraphAPI.users")
|
66
|
-
def
|
67
|
+
def test_get_plotly_calleventsummarygraph(self, mock_users, mock_acess, mvs, factory, empty_compare_employee):
|
67
68
|
request = APIRequestFactory().get("")
|
68
69
|
request.user = get_or_create_superuser()
|
69
70
|
|
@@ -740,5 +740,5 @@ def listen(request):
|
|
740
740
|
for notification in notifications:
|
741
741
|
# print(colored(f"{timezone.now():%Y-%m-%d %H:%M:%S.%f} {notification}", 'blue'))
|
742
742
|
if (resource_data := notification.get("resource_data")) and (id_event := resource_data.get("id")):
|
743
|
-
transaction.on_commit(lambda: handle_event_from_webhook.delay(id_event,
|
743
|
+
transaction.on_commit(lambda obj=notification: handle_event_from_webhook.delay(id_event, obj))
|
744
744
|
return HttpResponse(notifications, content_type="text/plain")
|
File without changes
|
File without changes
|
File without changes
|
{wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/admin.py
RENAMED
File without changes
|
{wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/apps.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/tasks.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{wbintegrator_office365-1.55.8 → wbintegrator_office365-1.55.10rc0}/wbintegrator_office365/urls.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|