diff --git a/.gitignore b/.gitignore index 058059f8..3c4022c7 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ # Emacs temp files *.*~ +\#* # database *.sqlite3 diff --git a/rowers/templates/partners.html b/rowers/templates/partners.html index bc16ff4e..e6e27d5d 100644 --- a/rowers/templates/partners.html +++ b/rowers/templates/partners.html @@ -37,7 +37,39 @@
-

 

+

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. + +

    +
  1. 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.
  2. +
  3. 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.
  4. +
  5. 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.
  6. +
  7. 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.
  8. +
  9. 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.
  10. + + +

{% 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/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: