Merge branch 'release/v10.30'
This commit is contained in:
+1
-2
@@ -67,7 +67,6 @@ Faker==1.0.4
|
||||
fitparse==1.1.0
|
||||
Flask==1.0.2
|
||||
future==0.17.1
|
||||
GDAL==2.3.3
|
||||
geocoder==1.38.1
|
||||
geos==0.2.1
|
||||
holoviews==1.11.3
|
||||
@@ -109,6 +108,7 @@ mistune==0.8.4
|
||||
mock==2.0.0
|
||||
more-itertools==6.0.0
|
||||
mpld3==0.3
|
||||
mysqlclient==1.4.2.post1
|
||||
nbconvert==5.4.1
|
||||
nbformat==4.4.0
|
||||
nose==1.3.7
|
||||
@@ -192,7 +192,6 @@ wcwidth==0.1.7
|
||||
webencodings==0.5.1
|
||||
Werkzeug==0.15.1
|
||||
widgetsnbextension==3.4.2
|
||||
winkerberos==0.7.0
|
||||
xlrd==1.2.0
|
||||
xmltodict==0.12.0
|
||||
yamjam==0.1.7
|
||||
|
||||
@@ -53,9 +53,11 @@
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<!-- Include formset plugin - including jQuery dependency -->
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="/static/js/jquery.formset.js"></script>
|
||||
<script>
|
||||
$('.fav-formset').formset({
|
||||
@@ -64,9 +66,30 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$('#id_workouttype').on('change', function(){
|
||||
if (
|
||||
$(this).val() == 'water'
|
||||
|| $(this).val() == 'coastal'
|
||||
|| $(this).val() == 'c-boat'
|
||||
|| $(this).val() == 'churchboat'
|
||||
) {
|
||||
$('#id_boattype').toggle(true);
|
||||
} else {
|
||||
$('#id_boattype').toggle(false);
|
||||
$('#id_boattype').val('1x');
|
||||
}
|
||||
|
||||
});
|
||||
$('#id_workouttype').change();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'menu_analytics.html' %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<ul class="main-content">
|
||||
<li class="grid_2">
|
||||
<h2>Alert {{ alert.name }} for {{ alert.rower.user.first_name }}</h2>
|
||||
<p>Alert managed by {{ alert.manager.first_name }} {{ alert.manager.last_name }}</p>
|
||||
<p>
|
||||
{{ formset.management_form }}
|
||||
{% csrf_token %}
|
||||
@@ -51,9 +52,11 @@
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<!-- Include formset plugin - including jQuery dependency -->
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="/static/js/jquery.formset.js"></script>
|
||||
<script>
|
||||
$('.fav-formset').formset({
|
||||
@@ -61,10 +64,29 @@
|
||||
deleteText: '<div><p> </p></div><div>remove</div>'
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$('#id_workouttype').on('change', function(){
|
||||
if (
|
||||
$(this).val() == 'water'
|
||||
|| $(this).val() == 'coastal'
|
||||
|| $(this).val() == 'c-boat'
|
||||
|| $(this).val() == 'churchboat'
|
||||
) {
|
||||
$('#id_boattype').toggle(true);
|
||||
} else {
|
||||
$('#id_boattype').toggle(false);
|
||||
$('#id_boattype').val('1x');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$('#id_workouttype').change();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'menu_analytics.html' %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<h2>{{ alert.name }}</h2>
|
||||
<p>{{ alert }}</p>
|
||||
<p>{{ alert.description }}</p>
|
||||
<p>Managed by {{ alert.manager.first_name }} {{ alert.manager.last_name }}</p>
|
||||
</li>
|
||||
<li class="rounder">
|
||||
<h2>Score</h2>
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
{% for alert in alerts %}
|
||||
<li class="rounder" id="alert_{{ alert.id }}">
|
||||
<h2>{{ alert.name }}</h2>
|
||||
{% if alert.manager == request.user %}
|
||||
<a class="small" href="/rowers/alerts/{{ alert.id }}/edit/" title="Edit">
|
||||
<i class="fas fa-pencil-alt fa-fw"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a class="small" href="/rowers/alerts/{{ alert.id }}/delete/"
|
||||
title="Delete">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$('#id_workouttype').on('change', function(){
|
||||
$('#id_workouttype').on('change', function(){
|
||||
if (
|
||||
$(this).val() == 'water'
|
||||
|| $(this).val() == 'coastal'
|
||||
|
||||
@@ -781,7 +781,7 @@ def mocked_requests(*args, **kwargs):
|
||||
if ststrokestester.match(args[0]).group(1) == '13':
|
||||
return MockResponse(ststrokesjson_nogps,200)
|
||||
else:
|
||||
return MockResponse(strokesjson,200)
|
||||
return MockResponse(ststrokesjson,200)
|
||||
if stuploadtester.match(args[0]):
|
||||
json_data = {
|
||||
"uris": [
|
||||
|
||||
@@ -445,6 +445,19 @@ class STObjects(DjangoTestCase):
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
@patch('rowers.imports.requests.get', side_effect=mocked_requests)
|
||||
def test_sporttracks_import_all(self, mock_get):
|
||||
|
||||
response = self.c.get('/rowers/workout/sporttracksimport/all/',follow=True)
|
||||
|
||||
expected_url = reverse('workouts_view')
|
||||
|
||||
self.assertRedirects(response,
|
||||
expected_url=expected_url,
|
||||
status_code=302,target_status_code=200)
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
@patch('rowers.dataprep.create_engine')
|
||||
def test_strokedata(self, mocked_sqlalchemy):
|
||||
with open('rowers/tests/testdata/sporttrackstestdata.txt','r') as infile:
|
||||
|
||||
@@ -317,7 +317,8 @@ def trendflexdata(workouts, options,userid=0):
|
||||
datadf['date'].replace(datemapping,inplace=True)
|
||||
|
||||
today = datetime.date.today()
|
||||
datadf['days ago'] = map(lambda x : x.days, datadf.date - today)
|
||||
datadf['days ago'] = list(map(lambda x : x.days, datadf.date - today))
|
||||
|
||||
|
||||
if groupby != 'date':
|
||||
try:
|
||||
|
||||
@@ -1551,12 +1551,11 @@ def workout_getsporttracksworkout_all(request):
|
||||
])
|
||||
newids = [stid for stid in stids if not stid in knownstids]
|
||||
for sporttracksid in newids:
|
||||
res = sporttracksstuff.get_sporttracks_workout(
|
||||
data,strokedata = sporttracksstuff.get_workout(
|
||||
request.user,sporttracksid)
|
||||
data = res.json()
|
||||
|
||||
id,message = add_workout_from_stdata(
|
||||
request.user,sporttracksid,data
|
||||
id,message = sporttracksstuff.add_workout_from_data(
|
||||
request.user,sporttracksid,data,strokedata
|
||||
)
|
||||
if id==0:
|
||||
messages.error(request,message)
|
||||
|
||||
@@ -803,6 +803,7 @@ def get_thumbnails(request,id):
|
||||
|
||||
|
||||
def get_blog_posts(request):
|
||||
try:
|
||||
response = requests.get(
|
||||
'https://analytics.rowsandall.com/wp-json/wp/v2/posts')
|
||||
if response.status_code == 200:
|
||||
@@ -811,6 +812,8 @@ def get_blog_posts(request):
|
||||
# o.write(json.dumps(blogs_json,indent=2,sort_keys=True))
|
||||
else:
|
||||
blogs_json = []
|
||||
except ConnectionError:
|
||||
pass
|
||||
|
||||
blogposts = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user