diff --git a/kitsune/questions/jinja2/questions/message/screen_share.ltxt b/kitsune/questions/jinja2/questions/message/screen_share.ltxt deleted file mode 100644 index 8cb2f13bfce..00000000000 --- a/kitsune/questions/jinja2/questions/message/screen_share.ltxt +++ /dev/null @@ -1,29 +0,0 @@ -Hi {{ asker }}, - -I'm {{ contributor }}, from the Mozilla support forums. - -We are offering screen sharing sessions for issues that are otherwise hard to solve such as in this case. If you are interested, please follow the instructions below to start a screen sharing session and I’ll join to help out with your issue. - -1. Start Firefox and click the Hello button (the smiley face in the Firefox tool bar). - -2. Click "Start a conversation", and in the new conversation window, click on "Copy link". - -3. Send me the link you've just copied by using one of the following methods: - -a. If you are reading this on the Mozilla support website, click "reply" below this message and paste the link you just copied. - -b. If you are reading this in your email program, please click on "View this message on the web". From there, click "reply". - -4. The Hello button will turn blue when I join the session. Just click the Hello button and click on the conversation link to join me. - -In case we miss each other right now, here’s when I’ll be available over the next 2 days. - -June 2nd, 9am - 11am PST - -June 3rd, 9am - 11am PST - -Just pick a time and reply together with the link you copied above. I’ll get back to you as soon as possible. - -Best, - -{{ contributor }} diff --git a/kitsune/questions/jinja2/questions/question_details.html b/kitsune/questions/jinja2/questions/question_details.html index 112c1c0ed19..9f3c4f83513 100644 --- a/kitsune/questions/jinja2/questions/question_details.html +++ b/kitsune/questions/jinja2/questions/question_details.html @@ -364,14 +364,6 @@

{{ _('Post a Reply') }}

  • {{ _("Subscribe to feed") }}
  • - {% if user.has_perm('users.screen_share') %} -
  • -
    - {% csrf_token %} - {{ _('Invite to share screen') }} -
    -
  • - {% endif %} {% if user.has_perm('flagit.can_moderate') %}
  • diff --git a/kitsune/questions/tests/test_views.py b/kitsune/questions/tests/test_views.py index 32829c60d95..0a1ff32c1a9 100644 --- a/kitsune/questions/tests/test_views.py +++ b/kitsune/questions/tests/test_views.py @@ -21,7 +21,6 @@ from kitsune.sumo.templatetags.jinja_helpers import urlparams from kitsune.sumo.tests import LocalizingClient, eq_msg, get, template_used from kitsune.sumo.urlresolvers import reverse -from kitsune.users.models import Profile from kitsune.users.tests import UserFactory, add_permission from kitsune.wiki.tests import DocumentFactory, RevisionFactory @@ -693,32 +692,6 @@ def test_answers_limit(self): eq_(4, Answer.objects.count()) -class TestScreenShare(TestCaseBase): - def setUp(self): - self.user = UserFactory() - add_permission(self.user, Profile, "screen_share") - self.question = QuestionFactory() - - def test_screen_share_answer(self): - """Test that the answer gets created when the screen sharing invite is sent.""" - eq_(self.question.answers.count(), 0) - self.client.login(username=self.user.username, password="testpass") - url = reverse("questions.screen_share", args=[self.question.id]) - res = self.client.post(url, follow=True) - eq_(res.status_code, 200) - eq_(self.question.answers.count(), 1) - - def test_screen_share_metadata(self): - """Test that the screen sharing meta data is added to the question.""" - eq_(self.question.metadata.get("screen_sharing"), None) - self.client.login(username=self.user.username, password="testpass") - url = reverse("questions.screen_share", args=[self.question.id]) - res = self.client.post(url, follow=True) - eq_(res.status_code, 200) - q = Question.objects.get(pk=self.question.pk) - eq_(q.metadata.get("screen_sharing"), "true") - - class TestStats(ElasticTestCase): client_class = LocalizingClient diff --git a/kitsune/questions/urls.py b/kitsune/questions/urls.py index dc3a1b8a6aa..a7179b5eb74 100644 --- a/kitsune/questions/urls.py +++ b/kitsune/questions/urls.py @@ -83,9 +83,6 @@ views.remove_tag_async, name="questions.remove_tag_async", ), - url( - r"^/(?P\d+)/screen-share/$", views.screen_share, name="questions.screen_share" - ), # Feeds # Note: this needs to be above questions.list because "feed" # matches the product slug regex. diff --git a/kitsune/questions/views.py b/kitsune/questions/views.py index 7b2a113e3a4..8e12ad5d071 100644 --- a/kitsune/questions/views.py +++ b/kitsune/questions/views.py @@ -62,7 +62,6 @@ from kitsune.upload.models import ImageAttachment from kitsune.upload.views import upload_imageattachment from kitsune.users.models import Setting -from kitsune.users.templatetags.jinja_helpers import display_name from kitsune.wiki.facets import topics_for from kitsune.wiki.utils import get_featured_articles @@ -1417,43 +1416,6 @@ def metrics(request, locale_code=None): return render(request, template, data) -@require_POST -@permission_required("users.screen_share") -def screen_share(request, question_id): - question = get_object_or_404(Question, pk=question_id, is_spam=False) - - if not question.allows_new_answer(request.user): - raise PermissionDenied - - content = _( - "I invited {user} to a screen sharing session, " - "and I'll give an update here once we are done." - ) - answer = Answer( - question=question, - creator=request.user, - content=content.format(user=display_name(question.creator)), - ) - answer.save() - - question.add_metadata(screen_sharing="true") - - if Setting.get_for_user(request.user, "questions_watch_after_reply"): - QuestionReplyEvent.notify(request.user, question) - - message = render_to_string( - "questions/message/screen_share.ltxt", - { - "asker": display_name(question.creator), - "contributor": display_name(request.user), - }, - ) - - return HttpResponseRedirect( - "%s?to=%s&message=%s" % (reverse("messages.new"), question.creator.username, message) - ) - - def _answers_data(request, question_id, form=None, watch_form=None, answer_preview=None): """Return a map of the minimal info necessary to draw an answers page.""" question = get_object_or_404(Question, pk=question_id) diff --git a/kitsune/users/migrations/0025_auto_20200926_0638.py b/kitsune/users/migrations/0025_auto_20200926_0638.py new file mode 100644 index 00000000000..b1c2963b7ea --- /dev/null +++ b/kitsune/users/migrations/0025_auto_20200926_0638.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.14 on 2020-09-26 06:38 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0024_auto_20200914_0433'), + ] + + operations = [ + migrations.AlterModelOptions( + name='profile', + options={'permissions': (('view_karma_points', 'Can view karma points'), ('deactivate_users', 'Can deactivate users'))}, + ), + ] diff --git a/kitsune/users/models.py b/kitsune/users/models.py index 031628930c2..f6dab7ffd26 100644 --- a/kitsune/users/models.py +++ b/kitsune/users/models.py @@ -115,7 +115,6 @@ class Meta(object): permissions = ( ("view_karma_points", "Can view karma points"), ("deactivate_users", "Can deactivate users"), - ("screen_share", "Can screen share"), ) def __str__(self):