@@ -3,6 +3,7 @@ from authentication.exceptions.business_host_exceptions.already_account import ( ) from authentication.exceptions.business_host_exceptions.already_has_plan import ( AlreadyHasPlan, + InviteeHasPlan ) from authentication.exceptions.business_host_exceptions.already_host import ( AlreadyHost, @@ -10,6 +11,7 @@ from authentication.exceptions.business_host_exceptions.already_host import ( __all__ = ( 'AlreadyHasPlan', + 'InviteeHasPlan', 'AlreadyHost', 'AlreadyAccount', ) @@ -6,5 +6,14 @@ class AlreadyHasPlan(Exception): return _( 'You already have an active tariff plan. You must request a ' 'cancellation of your current tariff plan (via the \"Report an error\" button), after which ' - 'you will be able to create a Corporate Account.' + 'you will be able to create a Corporate Account' + ) + + +class InviteeHasPlan(Exception): + def __str__(self) -> str: + return _( + 'Invitee already has an active tariff plan. Invitee must request a ' + 'cancellation of his current tariff plan (via the \"Report an error\" button), after which ' + 'you will be able to invite him' ) @@ -7,10 +7,7 @@ from rest_framework.request import Request from authentication.exceptions import business_host_exceptions from authentication.exceptions.business_account import BusinessAccountNotFound -from authentication.exceptions.business_host_exceptions import ( - AlreadyAccount, - AlreadyHasPlan, -) +from authentication.exceptions.business_host_exceptions import AlreadyAccount, InviteeHasPlan from authentication.exceptions.business_host_exceptions.access_denied import AccessDenied from authentication.exceptions.business_host_exceptions.already_host import ( AlreadyHost, @@ -95,7 +92,7 @@ class BusinessHostService: if AccountStatusSelector(user).is_business_account() and not user.is_deleted: raise AlreadyAccount(user) if PaymentPlanSelector(user).is_plan_paid(): - raise AlreadyHasPlan(user) + raise InviteeHasPlan(user) except CustomUserModel.DoesNotExist: return self.create_account( email=email, @@ -2,13 +2,13 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-05 17:44+0300\n" +"POT-Creation-Date: 2025-12-09 18:57+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,15 +30,25 @@ msgstr "Сотрудник не найден" msgid "You do not have sufficient rights to perform this action" msgstr "У вас недостаточно прав для выполнения этого действия" -#: authentication/exceptions/business_host_exceptions/already_has_plan.py:11 +#: authentication/exceptions/business_host_exceptions/already_has_plan.py:7 msgid "" "You already have an active tariff plan. You must request a cancellation of " -"your current tariff plan (via the \"Report an error\" button), after which you will be able to create a Corporate " -"Account." +"your current tariff plan (via the \"Report an error\" button), after which " +"you will be able to create a Corporate Account" msgstr "" "У вас уже активен тарифный план. Необходимо запросить аннулирование текущего " -"тарифного плана (через кнопку \"Сообщить об ошибке\"), после чего у вас появится возможность создать Корпоративный " -"Аккаунт" +"тарифного плана (через кнопку \"Сообщить об ошибке\"), после чего у вас " +"появится возможность создать Корпоративный Аккаунт" + +#: authentication/exceptions/business_host_exceptions/already_has_plan.py:16 +msgid "" +"Invitee already has an active tariff plan. Invitee must request a " +"cancellation of his current tariff plan (via the \"Report an error\" " +"button), after which you will be able to invite him" +msgstr "" +"У приглашенного уже активен тарифный план. Приглашенному необходимо запросить " +"аннулирование текущего тарифного плана (через кнопку \"Сообщить об " +"ошибке\"), после чего у вас появится возможность его пригласить" #: authentication/exceptions/business_host_exceptions/not_allowed_ip.py:6 msgid "Current IP not allowed in this context" @@ -232,11 +242,11 @@ msgstr "Приватные модели" msgid "Log history enabled" msgstr "История логов включена" -#: authentication/models/business_host.py:109 +#: authentication/models/business_host.py:113 msgid "Business Account" msgstr "Бизнес Аккаунт" -#: authentication/models/business_host.py:110 +#: authentication/models/business_host.py:114 msgid "Business Accounts" msgstr "Бизнес Аккаунты" @@ -494,19 +504,19 @@ msgstr "Пароли не совпадают" msgid "You cannot change the password of an unconfirmed e-mail user." msgstr "Вы не можете изменить пароль неподтвержденного по e-mail пользователя." -#: authentication/services/business_host_service.py:158 +#: authentication/services/business_host_service.py:155 msgid "No user_email is provided" msgstr "" -#: authentication/services/email_service.py:47 +#: authentication/services/email_service.py:51 msgid "Error occured when proceed email sending" msgstr "Случилась ошибка во время отправки email" -#: authentication/services/email_service.py:125 +#: authentication/services/email_service.py:107 msgid "Regular users cannot send introductory letters" msgstr "Обычные пользователи не могут отсылать письма" -#: authentication/services/email_service.py:160 +#: authentication/services/email_service.py:131 msgid "Regular users cannot send invitation letters" msgstr "Обычные пользователи не могут отправлять письма для приглашений" @@ -1175,7 +1185,7 @@ msgstr "Публичный API" msgid "Media" msgstr "Медиа" -#: tools/chats/apis.py:182 tools/media/apis.py:160 +#: tools/chats/apis.py:182 tools/media/apis.py:168 #: tools/public_api/views/base.py:103 msgid "" "Error occured when create generation. It may cause NSFW-content not allowed, "