Merge branch 'release/v23.1.9'
This commit is contained in:
+3
-1
@@ -87,6 +87,8 @@ def get_contacts(rower):
|
|||||||
res = requests.get(url, headers=headers)
|
res = requests.get(url, headers=headers)
|
||||||
|
|
||||||
dologging('idoklad.log','Searching Contact Status code '+str(res.status_code)+'\n')
|
dologging('idoklad.log','Searching Contact Status code '+str(res.status_code)+'\n')
|
||||||
|
#dologging('idoklad.log','Searching Contact Status code '+str(res.text)+'\n')
|
||||||
|
dologging('idoklad.log','Searching Contact Status code '+str(res.reason)+'\n')
|
||||||
|
|
||||||
if res.status_code != 200: # pragma: no cover
|
if res.status_code != 200: # pragma: no cover
|
||||||
return None
|
return None
|
||||||
@@ -146,7 +148,7 @@ def create_contact(rower):
|
|||||||
res = requests.post(contacts_url, json=data, headers=headers)
|
res = requests.post(contacts_url, json=data, headers=headers)
|
||||||
|
|
||||||
if res.status_code not in [200, 201]:
|
if res.status_code not in [200, 201]:
|
||||||
dologging('idoklad.log','Contact Created - reason '+str(res.reason)+'\n')
|
dologging('idoklad.log','Contact Not Created - reason '+str(res.reason)+'\n')
|
||||||
_ = myqueue(
|
_ = myqueue(
|
||||||
queuehigh, handle_send_email_noinvoice,
|
queuehigh, handle_send_email_noinvoice,
|
||||||
rower.user.email,
|
rower.user.email,
|
||||||
|
|||||||
@@ -1258,6 +1258,7 @@ class Rower(models.Model):
|
|||||||
|
|
||||||
imports_are_private = models.BooleanField(default=False, verbose_name='Make imports private by default')
|
imports_are_private = models.BooleanField(default=False, verbose_name='Make imports private by default')
|
||||||
show_commutes = models.BooleanField(default=False, verbose_name='Show commutes in workout list')
|
show_commutes = models.BooleanField(default=False, verbose_name='Show commutes in workout list')
|
||||||
|
small_commutes = models.BooleanField(default=False, verbose_name='Show commutes on a single line in workout list')
|
||||||
|
|
||||||
# Friends/Team
|
# Friends/Team
|
||||||
friends = models.ManyToManyField("self", blank=True)
|
friends = models.ManyToManyField("self", blank=True)
|
||||||
@@ -5182,6 +5183,7 @@ class AccountRowerForm(ModelForm):
|
|||||||
'defaultlandingpage2',
|
'defaultlandingpage2',
|
||||||
'defaultlandingpage3',
|
'defaultlandingpage3',
|
||||||
'show_commutes',
|
'show_commutes',
|
||||||
|
'small_commutes',
|
||||||
'offercoaching', 'autojoin', 'emailalternatives']
|
'offercoaching', 'autojoin', 'emailalternatives']
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
|
|||||||
+2
-2
@@ -1804,7 +1804,7 @@ def sigdig(value, digits=3):
|
|||||||
def handle_send_email_noinvoice(
|
def handle_send_email_noinvoice(
|
||||||
useremail, userfirstname, userlastname, reason, **kwargs):
|
useremail, userfirstname, userlastname, reason, **kwargs):
|
||||||
|
|
||||||
subject = "Reason"
|
subject = "Idoklad: No invoice created"
|
||||||
|
|
||||||
from_email = 'Rowsandall <admin@rowsandall.com>'
|
from_email = 'Rowsandall <admin@rowsandall.com>'
|
||||||
d = {
|
d = {
|
||||||
@@ -1813,7 +1813,7 @@ def handle_send_email_noinvoice(
|
|||||||
'reason': reason,
|
'reason': reason,
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = send_template_email(from_email, support@rowsandall.com, subject,
|
_ = send_template_email(from_email, "support@rowsandall.com", subject,
|
||||||
'paymentconfirmationemail_noinvoice.html',
|
'paymentconfirmationemail_noinvoice.html',
|
||||||
d, **kwargs)
|
d, **kwargs)
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,11 @@
|
|||||||
</h1>
|
</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if nr_commutes %}
|
||||||
|
<p>
|
||||||
|
<a href="?show_commutes=true">Show {{ nr_commutes }} commutes</a>
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_4">
|
<li class="grid_4">
|
||||||
@@ -104,7 +109,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for workout in workouts %}
|
{% for workout in workouts %}
|
||||||
{% if not workout.is_commute %}
|
{% if not workout.is_commute or not user.rower.small_commutes %}
|
||||||
<li class="grid_4 divlines">
|
<li class="grid_4 divlines">
|
||||||
{% if request.GET.selectworkouts %}
|
{% if request.GET.selectworkouts %}
|
||||||
<input type="checkbox" id="workoutid" value={{ workout.id|encode }} name="workoutid" />
|
<input type="checkbox" id="workoutid" value={{ workout.id|encode }} name="workoutid" />
|
||||||
@@ -202,7 +207,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% elif user.rower.show_commutes %}
|
{% elif show_commutes and user.rower.small_commutes %}
|
||||||
<li class="grid_4 divlines">
|
<li class="grid_4 divlines">
|
||||||
<div class="workoutcontainer">
|
<div class="workoutcontainer">
|
||||||
<div class="workoutelement">
|
<div class="workoutelement">
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -2145,6 +2145,10 @@ def workouts_view(request, message='', successmessage='',
|
|||||||
request.session['referer'] = absolute(request)['PATH']
|
request.session['referer'] = absolute(request)['PATH']
|
||||||
r = getrequestrower(request, rowerid=rowerid, userid=userid)
|
r = getrequestrower(request, rowerid=rowerid, userid=userid)
|
||||||
|
|
||||||
|
show_commutes = request.GET.get('show_commutes', False)
|
||||||
|
if show_commutes == 'true':
|
||||||
|
show_commutes = True
|
||||||
|
|
||||||
# check if access is allowed
|
# check if access is allowed
|
||||||
|
|
||||||
startdate = datetime.datetime.combine(startdate, datetime.time())
|
startdate = datetime.datetime.combine(startdate, datetime.time())
|
||||||
@@ -2264,9 +2268,13 @@ def workouts_view(request, message='', successmessage='',
|
|||||||
g_enddate = timezone.now()
|
g_enddate = timezone.now()
|
||||||
g_startdate = (timezone.now()-timedelta(days=15))
|
g_startdate = (timezone.now()-timedelta(days=15))
|
||||||
|
|
||||||
if not r.show_commutes:
|
nr_commutes = 0
|
||||||
|
show_commutes = show_commutes or r.show_commutes
|
||||||
|
if not show_commutes:
|
||||||
|
nr_commutes = workouts.filter(is_commute=True).count()
|
||||||
workouts = workouts.exclude(is_commute=True)
|
workouts = workouts.exclude(is_commute=True)
|
||||||
|
|
||||||
|
|
||||||
workoutsnohr = workouts.exclude(averagehr__isnull=False)
|
workoutsnohr = workouts.exclude(averagehr__isnull=False)
|
||||||
for w in workoutsnohr: # pragma: no cover
|
for w in workoutsnohr: # pragma: no cover
|
||||||
_ = dataprep.workout_trimp(w)
|
_ = dataprep.workout_trimp(w)
|
||||||
@@ -2358,6 +2366,8 @@ def workouts_view(request, message='', successmessage='',
|
|||||||
'totalmeters': totalmeters,
|
'totalmeters': totalmeters,
|
||||||
'totalminutes': totalminutes,
|
'totalminutes': totalminutes,
|
||||||
'totalhours': totalhours,
|
'totalhours': totalhours,
|
||||||
|
'nr_commutes': nr_commutes,
|
||||||
|
'show_commutes': show_commutes,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user