Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
[fix bug 1292003] Remove get_involved form from events.
Browse files Browse the repository at this point in the history
  • Loading branch information
akatsoulas committed Dec 21, 2016
1 parent c9cf7bd commit 54201c6
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 77 deletions.
2 changes: 0 additions & 2 deletions remo/events/e_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
{'subscribe': True}, name='events_subscribe_to_event'),
url(r'^(?P<slug>[a-z0-9-]+)/unsubscribe/$', events_views.manage_subscription,
{'subscribe': False}, name='events_unsubscribe_from_event'),
url(r'^(?P<slug>[a-z0-9-]+)/plusoneconverted/$', events_views.count_converted_visitors,
name='events_count_converted_visitors'),
url(r'^(?P<slug>[a-z0-9-]+)/ical/$', events_views.export_single_event_to_ical,
name='events_icalendar_event'),
url(r'^(?P<slug>[a-z0-9-]+)/emailattendees/$', events_views.email_attendees,
Expand Down
18 changes: 0 additions & 18 deletions remo/events/templates/view_event.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -523,24 +523,6 @@ Mozilla Reps - {{ event.name }}
Planning pad
</a>
</div>
<p>
Use the "Get Involved" form to help people at your event sign up to Mozilla's Get Involved page.
</p>
<p>
This form will enable you to automatically keep track of their sign-ups during your event.
</p>
<div class="row">
<div class="large-6 columns event-single-signups-count">
Sign-ups count: {{ event.converted_visitors }}
</div>
<div class="large-6 columns align-right">
<a href="{{ get_contribute_link(event) }}"
target="_blank"
class="small button">
Get involved form
</a>
</div>
</div>
</div>
</div>

Expand Down
17 changes: 0 additions & 17 deletions remo/events/templatetags/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
from remo.base.templatetags.helpers import urlparams


@library.filter
def get_event_converted_visitor_callback_url(obj):
"""Return event converted visitor callback url."""
return settings.SITE_URL + reverse('events_count_converted_visitors',
kwargs={'slug': obj.slug})


@library.global_function
def get_link_to_osm(lat, lon, zoom=15):
"""Return link to OSM centered in lat, lon."""
Expand Down Expand Up @@ -80,16 +73,6 @@ def get_total_attendees(event):
return event.attendees.all().count()


@library.global_function
def get_contribute_link(event):
"""Returns custom link to m.o/contribute."""

return (settings.CONTRIBUTE_URL %
{'callbackurl': (settings.SITE_URL +
reverse('events_count_converted_visitors',
kwargs={'slug': event.slug}))})


@library.filter
def get_event_comment_delete_url(obj):
"""Return the delete url of an event comment."""
Expand Down
14 changes: 2 additions & 12 deletions remo/events/tests/test_helpers.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import datetime

from django.conf import settings
from django.core.urlresolvers import reverse

from nose.tools import eq_, ok_

from remo.base.templatetags.helpers import urlparams
from remo.base.tests import RemoTestCase
from remo.events.templatetags.helpers import (get_contribute_link, get_event_search_link,
get_sorted_attendance_list, is_multiday)
from remo.events.templatetags.helpers import (get_event_search_link, get_sorted_attendance_list,
is_multiday)
from remo.events.tests import AttendanceFactory, EventFactory, START_DT
from remo.reports import ACTIVITY_EVENT_CREATE
from remo.reports.tests import ActivityFactory
Expand Down Expand Up @@ -44,15 +43,6 @@ def test_attendance_list_sorting(self):
eq_(copy_list, sorted_list[1:],
'List is not properly sorted.')

def test_contribute_link(self):
"""Test /contribute link generation."""
e = EventFactory.create(start=START_DT, end=self.single_day_end)
url = (settings.CONTRIBUTE_URL %
{'callbackurl': (settings.SITE_URL +
reverse('events_count_converted_visitors',
kwargs={'slug': e.slug}))})
eq_(get_contribute_link(e), url)

def test_get_event_search_link(self):
"""Test event search link generation."""
search = 'SearchTerm'
Expand Down
10 changes: 0 additions & 10 deletions remo/events/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,6 @@ def test_delete_event_admin(self, mock_success):
ok_(not Event.objects.filter(pk=event.id).exists())
mock_success.assert_called_with(ANY, 'Event successfully deleted.')

def test_converted_visitors(self):
"""Test converted visitors counter."""
event = EventFactory.create()
converted_visitors = event.converted_visitors + 1
self.client.post(reverse('events_count_converted_visitors',
kwargs={'slug': event.slug}),
follow=True)
event = Event.objects.get(slug=event.slug)
eq_(event.converted_visitors, converted_visitors)

def test_export_event_to_ical(self):
"""Test ical export."""
event = EventFactory.create()
Expand Down
15 changes: 0 additions & 15 deletions remo/events/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from django.utils.safestring import mark_safe
from django.utils.timezone import now
from django.views.decorators.cache import cache_control, never_cache
from django.views.decorators.csrf import csrf_exempt

from django_statsd.clients import statsd

Expand Down Expand Up @@ -252,20 +251,6 @@ def delete_event(request, slug):
return redirect('events_list_events')


@never_cache
@csrf_exempt
def count_converted_visitors(request, slug):
"""Increase event subscribers."""
event = get_object_or_404(Event, slug=slug)

if request.method == 'POST':
event.converted_visitors += 1
event.save()
return HttpResponse('OK')

return redirect('events_view_event', slug=event.slug)


@cache_control(max_age=1800, s_maxage=1800)
def export_single_event_to_ical(request, slug):
"""ICal export of single event."""
Expand Down
3 changes: 0 additions & 3 deletions remo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@
ETHERPAD_URL = 'https://public.etherpad-mozilla.org/p/'
ETHERPAD_PREFIX = 'remo-'

CONTRIBUTE_URL = 'http://www.mozilla.org/contribute/event/?callbackurl=%(callbackurl)s'


REPS_MENTORS_LIST = '[email protected]'
REPS_COUNCIL_ALIAS = '[email protected]'
REPS_REVIEW_ALIAS = '[email protected]'
Expand Down

0 comments on commit 54201c6

Please sign in to comment.