wbcrm 1.50.9__py2.py3-none-any.whl → 1.50.11__py2.py3-none-any.whl
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.
Potentially problematic release.
This version of wbcrm might be problematic. Click here for more details.
wbcrm/filters/accounts.py
CHANGED
|
@@ -34,7 +34,7 @@ class AccountFilter(wb_filters.FilterSet):
|
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
status = wb_filters.MultipleChoiceFilter(
|
|
37
|
-
choices=Account.Status.choices, label="Status",
|
|
37
|
+
choices=Account.Status.choices, label="Status", initial=[Account.Status.OPEN.value]
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
def filter_not_owner(self, queryset, name, value):
|
|
@@ -59,7 +59,7 @@ class AccountFilter(wb_filters.FilterSet):
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
class AccountRoleFilterSet(wb_filters.FilterSet):
|
|
62
|
-
is_currently_valid = wb_filters.BooleanFilter(label="Valid",
|
|
62
|
+
is_currently_valid = wb_filters.BooleanFilter(label="Valid", initial=True, field_name="is_currently_valid")
|
|
63
63
|
|
|
64
64
|
class Meta:
|
|
65
65
|
model = AccountRole
|
wbcrm/serializers/accounts.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
from django.apps import apps
|
|
2
|
+
from django.contrib.messages import warning
|
|
3
|
+
from django.utils.translation import gettext_lazy as _
|
|
2
4
|
from rest_framework.reverse import reverse
|
|
3
5
|
from rest_framework.validators import UniqueValidator
|
|
4
6
|
from wbcore import serializers as wb_serializers
|
|
7
|
+
from wbcore.contrib.authentication.models import User
|
|
5
8
|
from wbcore.contrib.authentication.serializers import UserRepresentationSerializer
|
|
6
9
|
from wbcore.contrib.directory.serializers import EntryRepresentationSerializer
|
|
7
10
|
|
|
@@ -106,11 +109,19 @@ class AccountRoleModelSerializer(wb_serializers.ModelSerializer):
|
|
|
106
109
|
# We return a get or create role because we don't want to leak information on already existing role that the user might not be able to see
|
|
107
110
|
# this way, the account role (even if already existing) will be returned and the permission mixin will take over
|
|
108
111
|
authorized_hidden_users = validated_data.pop("authorized_hidden_users", [])
|
|
109
|
-
instance,
|
|
112
|
+
instance, created = AccountRole.objects.get_or_create(
|
|
110
113
|
entry=validated_data.pop("entry"), account=validated_data.pop("account"), defaults=validated_data
|
|
111
114
|
)
|
|
112
115
|
if authorized_hidden_users:
|
|
113
116
|
instance.authorized_hidden_users.set(authorized_hidden_users)
|
|
117
|
+
if request := self.context.get("request"):
|
|
118
|
+
if not User.objects.filter(profile_id=instance.entry.id).exists():
|
|
119
|
+
warning(
|
|
120
|
+
request,
|
|
121
|
+
_(
|
|
122
|
+
"The selected entry does not have an associated user account. Note: Notifications cannot be sent to users without an account."
|
|
123
|
+
),
|
|
124
|
+
)
|
|
114
125
|
return instance
|
|
115
126
|
|
|
116
127
|
class Meta:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wbcrm
|
|
3
|
-
Version: 1.50.
|
|
3
|
+
Version: 1.50.11
|
|
4
4
|
Summary: A workbench module that contains all the functionality related to a customer relationship management.
|
|
5
5
|
Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
|
|
6
6
|
Requires-Dist: django-eventtools==1.*
|
|
@@ -19,7 +19,7 @@ wbcrm/factories/activities.py,sha256=Nb5ysYxhAguePn6aSdFrNqAScpaZ-OezH-q6ODFlLDE
|
|
|
19
19
|
wbcrm/factories/groups.py,sha256=OWmGk-H9zEnLOo_5oe4czSVvAUUOfrpUmVHgG9xvtak,621
|
|
20
20
|
wbcrm/factories/products.py,sha256=UuhCaSZsrmIA8ccj80gAaNNlAmhcKLjwDwNOvE3BHro,244
|
|
21
21
|
wbcrm/filters/__init__.py,sha256=ZX47xCq18N_FTvvFCk2mIlFoValKFaTcxw9xv8qdn0E,305
|
|
22
|
-
wbcrm/filters/accounts.py,sha256=
|
|
22
|
+
wbcrm/filters/accounts.py,sha256=JI1Xv_Tvrva7p-4ErKzGh4PrVZxnJiWZYF8KHTEbkbE,2330
|
|
23
23
|
wbcrm/filters/activities.py,sha256=y1MmnXlypIcDfj4P3oa3VbAHY1LTwGamUeeX6h6XbDs,7783
|
|
24
24
|
wbcrm/filters/groups.py,sha256=X6XC5nUZOlOwuJJxjl0tD9-FfzFkwIDeIXUdbQ1GHMs,624
|
|
25
25
|
wbcrm/filters/products.py,sha256=K1ZJ4hhMibv0YBnQyzlPqg4KkT-uq_fGVNVJPzlP8j0,1204
|
|
@@ -56,7 +56,7 @@ wbcrm/models/llm/activity_summaries.py,sha256=Z1nxxdVuoNVGwXr9UH9thNmdHhl29GMsQg
|
|
|
56
56
|
wbcrm/models/llm/analyze_relationship.py,sha256=AsOXela63Mqz-5-xo_vOc5mMfDazO-Ixm1tYbgkY0KU,2337
|
|
57
57
|
wbcrm/report/activity_report.py,sha256=Y2NveP9u6CeXImXtxR4XfZK-2CFBa5CnUG-jx35Msnc,4843
|
|
58
58
|
wbcrm/serializers/__init__.py,sha256=qKwo5e-Ix-Iow1RRdKFC0uZQmuSHzc8DIypIhi_E8HI,726
|
|
59
|
-
wbcrm/serializers/accounts.py,sha256=
|
|
59
|
+
wbcrm/serializers/accounts.py,sha256=F7fJAa4lamkuQxfiLU08iE4vCaDtiMtcxwTFowxHnMk,5552
|
|
60
60
|
wbcrm/serializers/activities.py,sha256=krziaCnOvDCvelteRiJp7LT1whDUQKopKKtXDEwxQm4,21847
|
|
61
61
|
wbcrm/serializers/groups.py,sha256=YqiHGiytbD1lIuSUEBk4CwlwipAFs_uh2V9DZG7JukQ,783
|
|
62
62
|
wbcrm/serializers/products.py,sha256=xBv5l2xgrUQRIjlqe_qKTiWDcp0lOq5FHDBms9lm_V0,2002
|
|
@@ -170,6 +170,6 @@ wbcrm/viewsets/titles/products.py,sha256=cFAK5zljjybabk2U0KzPT2PVfV5vmO_UlJd6QlI
|
|
|
170
170
|
wbcrm/viewsets/titles/utils.py,sha256=IaHQTmEG2OwIHS1bRv7sjuT950wefUJNi3yvPdrpNEs,1144
|
|
171
171
|
wbcrm/workflows/__init__.py,sha256=biwXXPkVJugT9Vc1cwbInAUY8EnVmOauxdPz7e_2w_A,32
|
|
172
172
|
wbcrm/workflows/assignee_methods.py,sha256=L7ymErtcpFgXdTMTj_lDOVJqsLAGLNT6qMlrkHGuXWM,999
|
|
173
|
-
wbcrm-1.50.
|
|
174
|
-
wbcrm-1.50.
|
|
175
|
-
wbcrm-1.50.
|
|
173
|
+
wbcrm-1.50.11.dist-info/METADATA,sha256=d9YOKrC1_hoipdceahicWzORW8tufyM3lPBRMEQeQko,451
|
|
174
|
+
wbcrm-1.50.11.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
|
|
175
|
+
wbcrm-1.50.11.dist-info/RECORD,,
|
|
File without changes
|