wbcrm 1.50.10__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.

@@ -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, _ = AccountRole.objects.get_or_create(
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.10
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.*
@@ -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=db7jXPITOuE2e2zgIM1s__UMiTMnEBowY9y-S3HMGYA,4994
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.10.dist-info/METADATA,sha256=zDUDVhIN0-TsNjPl3ENiA6onde3MHQfIGZ37dIsfyCs,451
174
- wbcrm-1.50.10.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
175
- wbcrm-1.50.10.dist-info/RECORD,,
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,,