diff --git a/rowers/templates/partners.html b/rowers/templates/partners.html
new file mode 100644
index 00000000..e6e27d5d
--- /dev/null
+++ b/rowers/templates/partners.html
@@ -0,0 +1,75 @@
+
+{% extends "base.html" %}
+{% block title %}About us{% endblock title %}
+{% block content %}
+
+
+
Are you interested in partnering with Rowsandall.com?
+
+
We are open to working together with partners serving the rowing
+ community. To maintain maximum transparency to our users, we have
+ the following principles for collaboration:
+
+
+ - On blog.rowsandall.com, analytics.rowsandall.com and in through
+ our Twitter account, we write about hardware, software, and other
+ rowing related kit that we have used, tested, and are enthusiastic about.
+ - If you send us a unit, or a piece of software to test, we will not
+ write a public review about it. If we like the unit (software, etc) and
+ keep using it, you may see it appear in our blog posts. If there are
+ reasons why we are not satisfied with the unit, but we feel that
+ an improved version would serve the rowing community, we will contact
+ you with constructive criticism. We will do our best not to mention
+ your product in
+ a negative way on our public blogs or twitter. However, we retain the
+ freedom to engage in online discussions about your product, but will
+ try to keep our communication factual.
+ - We encourage vendors to send us their products for testing. We are
+ especially interested in software and hardware used for indoor and
+ on-the-water rowing. We want to avoid the hassle of sending back
+ your products, so we will not send back any item that has a value of
+ less than 1000 EURO. If you want us to test an item of higher value,
+ please mention this when you contact us.
+
+
+
+
+
+
+
+
Examples of possible partnerships
+
+ We currently envision a couple of ways in which we can partner with
+ your business. We are open for other models. If you have an interesting
+ proposition or want to use one of the partnership models listed below,
+ please contact us by email.
+
+
+ - Sponsorship of Pro membership.
+ You distribute coupon codes giving right to a year of
+ Pro membership to the receiver of the coupon. The coupon can be
+ redeemed on this website by the user. He or she will get a year of
+ Pro membership sponsored by you. Rowsandall.com will send you a
+ regular invoice based on the number of redeemed coupons.
+ - Purchasing blocks of Pro membership coupons.
+ This is similar to the above, except that you pay in advance (at
+ a reduced rate) a "block" of Pro membership coupons.
+ - Advertising. If you decide to support rowsandall.com through
+ advertising, we will create a top banner where you as a sponsor
+ have space to put up a clickable picture. Price and content open
+ for negotiation.
+ - Collaboration on prototypes or beta versions of your new products
+ (or product upgrades). You send us a product ahead of release (under
+ a confidentiality agreement) and we use it and provide feedback.
+ We will make no public comments or posts about the product, nor
+ would we inform anyone else.
+ - Long term product feedback. Typically in the product design phase.
+ We would act as a sounding board for ideas, could provide feedback
+ on the data related features of the product. We would charge for our
+ time according to an agreed price.
+
+
+
+
+
+ {% endblock content %}
diff --git a/rowers/tests.py b/rowers/tests.py
index 7966ad25..ffb4d821 100644
--- a/rowers/tests.py
+++ b/rowers/tests.py
@@ -1,4 +1,6 @@
from django.test import TestCase, Client,override_settings
+from django.core.management import call_command
+from django.utils.six import StringIO
from django.test.client import RequestFactory
from .views import checkworkoutuser,c2_open
from rowers.models import Workout, User, Rower, WorkoutForm,RowerForm,GraphImage
@@ -43,6 +45,12 @@ class DjangoTestCase(TestCase, MockTestCase):
# Create your tests here.
+class EmailProcessTest(TestCase):
+ def test_emailprocessing(self):
+ out = StringIO()
+ call_command('processemail', stdout=out)
+ self.assertIn('Successfully processed email attachments',out.getvalue())
+
class C2Objects(DjangoTestCase):
def test_strokedata(self):
with open('rowers/testdata/c2stroketestdata.txt','r') as infile:
diff --git a/rowers/urls.py b/rowers/urls.py
index ae58dcad..18ab3665 100644
--- a/rowers/urls.py
+++ b/rowers/urls.py
@@ -194,6 +194,7 @@ urlpatterns = [
url(r'^workout/fusion/(?P
\d+)/(?P\d+-\d+-\d+)/(?P\w+.*)$',views.workout_fusion_list),
url(r'^physics$',TemplateView.as_view(template_name='physics.html'),name='physics'),
+ url(r'^partners$',TemplateView.as_view(template_name='partners.html'),name='partners'),
url(r'^workout/(\d+)/$',views.workout_view),
url(r'^workout/(\d+)/addtimeplot$',views.workout_add_timeplot_view),
url(r'^workout/(\d+)/addpiechart$',views.workout_add_piechart_view),
diff --git a/rowers/views.py b/rowers/views.py
index 2294a87f..c5dddf18 100644
--- a/rowers/views.py
+++ b/rowers/views.py
@@ -5215,17 +5215,19 @@ def workout_upload_view(request,message="",
return HttpResponseRedirect("/rowers/me/c2authorize/")
try:
c2userid = c2stuff.get_userid(thetoken)
+ if not c2userid:
+ return HttpResponseRedirect("/rowers/me/c2authorize")
data = c2stuff.createc2workoutdata(w)
authorizationstring = str('Bearer ' + thetoken)
headers = {'Authorization': authorizationstring,
'user-agent': 'sanderroosendaal',
'Content-Type': 'application/json'}
import urllib
- url = "httpvs://log.concept2.com/api/users/%s/results" % (c2userid)
+ url = "https://log.concept2.com/api/users/%s/results" % (c2userid)
response = requests.post(url,headers=headers,data=json.dumps(data))
# response = c2stuff.workout_c2_upload(request.user,w)
- if (response.status_code != 201):
+ if (response.status_code != 201 and response.status_code != 200):
if settings.DEBUG:
return HttpResponse(response)
else: