Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Déplace des utilitaires liés au MP de 'utils' vers 'mp' #6285

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zds/member/commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from zds.member.models import Profile, TokenRegister, Ban
from zds.utils.models import get_hat_from_settings
from zds.utils.mps import send_mp
from zds.mp.utils import send_mp


class ProfileCreate:
Expand Down
2 changes: 1 addition & 1 deletion zds/member/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from zds.member.forms import PromoteMemberForm
from zds.member.models import Profile
from zds.utils.models import get_hat_from_settings
from zds.utils.mps import send_mp
from zds.mp.utils import send_mp


@login_required
Expand Down
2 changes: 1 addition & 1 deletion zds/member/views/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
)
import logging

from zds.utils.mps import send_mp
from zds.mp.utils import send_mp


class RegisterView(CreateView, ProfileCreate, TokenGenerator):
Expand Down
2 changes: 1 addition & 1 deletion zds/mp/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from zds.mp.commons import UpdatePrivatePost
from zds.mp.models import PrivateTopic, PrivatePost
from zds.mp.validators import ParticipantsUserValidator, TitleValidator, TextValidator
from zds.utils.mps import send_mp, send_message_mp
from zds.mp.utils import send_mp, send_message_mp


class PrivatePostSerializer(ZdSModelSerializer):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion zds/mp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from zds.mp.decorator import is_participant
from zds.utils.models import get_hat_from_request
from zds.utils.forums import CreatePostView
from zds.utils.mps import send_mp, send_message_mp
from zds.mp.utils import send_mp, send_message_mp
from zds.utils.paginator import ZdSPagingListView
from .forms import PrivateTopicForm, PrivatePostForm, PrivateTopicEditForm
from .models import PrivateTopic, PrivatePost, mark_read, NotReachableError
Expand Down
2 changes: 1 addition & 1 deletion zds/notification/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from zds.member.tests.factories import ProfileFactory
from zds.mp.tests.factories import PrivateTopicFactory
from zds.notification.models import Notification
from zds.utils.mps import send_message_mp
from zds.mp.utils import send_message_mp


class NotificationListAPITest(APITestCase):
Expand Down
2 changes: 1 addition & 1 deletion zds/notification/tests/tests_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from zds.tutorialv2.publication_utils import publish_content
from zds.utils import old_slugify
from zds.utils.tests.factories import SubCategoryFactory, LicenceFactory
from zds.utils.mps import send_mp, send_message_mp
from zds.mp.utils import send_mp, send_message_mp


class NotificationForumTest(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion zds/notification/tests/tests_tricky.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from zds.tutorialv2.publication_utils import publish_content, notify_update
from zds.tutorialv2.tests import TutorialTestMixin, override_for_contents
from zds.utils.tests.factories import SubCategoryFactory, LicenceFactory
from zds.utils.mps import send_mp, send_message_mp
from zds.mp.utils import send_mp, send_message_mp
from zds.utils.header_notifications import get_header_notifications

overridden_zds_app = deepcopy(settings.ZDS_APP)
Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/management/commands/migrate_to_zep25.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.conf import settings
from zds.tutorialv2.models.database import PublishableContent
from zds.utils.models import Category, SubCategory, CategorySubCategory, Tag
from zds.utils.mps import send_mp
from zds.mp.utils import send_mp


@transaction.atomic
Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/views/authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from zds.tutorialv2.forms import AuthorForm, RemoveAuthorForm
from zds.tutorialv2.mixins import SingleContentFormViewMixin
from zds.utils.models import get_hat_from_settings
from zds.utils.mps import send_mp
from zds.mp.utils import send_mp


class AddAuthorToContent(LoggedWithReadWriteHability, SingleContentFormViewMixin):
Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/views/beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from zds.tutorialv2.models.database import PublishableContent
from zds.utils.forums import create_topic, send_post, lock_topic, unlock_topic
from zds.utils.models import get_hat_from_settings
from zds.utils.mps import send_mp, send_message_mp
from zds.mp.utils import send_mp, send_message_mp


class ManageBetaContent(LoggedWithReadWriteHability, SingleContentFormViewMixin):
Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/views/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from zds.tutorialv2.utils import init_new_repo
from zds.tutorialv2.views.authors import RemoveAuthorFromContent
from zds.utils.models import get_hat_from_settings
from zds.utils.mps import send_mp, send_message_mp
from zds.mp.utils import send_mp, send_message_mp
from zds.utils.uuslug_wrapper import slugify

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/views/contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from zds.tutorialv2.mixins import SingleContentFormViewMixin
from zds.tutorialv2.models import TYPE_CHOICES_DICT
from zds.tutorialv2.models.database import ContentContribution, PublishableContent
from zds.utils.mps import send_mp
from zds.mp.utils import send_mp
from zds.utils.paginator import ZdSPagingListView


Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/views/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from zds.tutorialv2.forms import WarnTypoForm
from zds.tutorialv2.mixins import SingleOnlineContentViewMixin, SingleContentFormViewMixin
from zds.tutorialv2.utils import search_container_or_404
from zds.utils.mps import send_mp
from zds.mp.utils import send_mp


class RequestFeaturedContent(LoggedWithReadWriteHability, FeatureableMixin, SingleOnlineContentViewMixin, FormView):
Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/views/validations_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
save_validation_state,
)
from zds.utils.models import SubCategory, get_hat_from_settings
from zds.utils.mps import send_mp, send_message_mp
from zds.mp.utils import send_mp, send_message_mp

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/views/validations_opinions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from zds.tutorialv2.utils import clone_repo
from zds.tutorialv2.views.validations_contents import logger
from zds.utils.models import get_hat_from_settings
from zds.utils.mps import send_mp, send_message_mp
from zds.mp.utils import send_mp, send_message_mp


class PublishOpinion(LoggedWithReadWriteHability, DoesNotRequireValidationFormViewMixin):
Expand Down
3 changes: 1 addition & 2 deletions zds/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from django.conf import settings

from django.contrib.auth.models import User, Group
from django.db.models.signals import post_save
from django.urls import reverse
from django.utils.encoding import smart_str
from django.db import models
Expand All @@ -21,7 +20,7 @@
from zds.utils import signals
from zds.mp.models import PrivateTopic
from zds.tutorialv2.models import TYPE_CHOICES, TYPE_CHOICES_DICT
from zds.utils.mps import send_mp
from zds.mp.utils import send_mp
from zds.utils import old_slugify
from zds.utils.misc import contains_utf8mb4
from zds.utils.templatetags.emarkdown import render_markdown
Expand Down
2 changes: 1 addition & 1 deletion zds/utils/tests/tests_interventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from zds.tutorialv2.tests.factories import PublishableContentFactory
from zds.member.tests.factories import ProfileFactory, StaffProfileFactory
from zds.utils.tests.factories import SubCategoryFactory, LicenceFactory
from zds.utils.mps import send_message_mp, send_mp
from zds.mp.utils import send_message_mp, send_mp


class InterventionsTest(TestCase):
Expand Down