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)
|
||||
|
||||
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
|
||||
return None
|
||||
@@ -146,7 +148,7 @@ def create_contact(rower):
|
||||
res = requests.post(contacts_url, json=data, headers=headers)
|
||||
|
||||
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(
|
||||
queuehigh, handle_send_email_noinvoice,
|
||||
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')
|
||||
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 = models.ManyToManyField("self", blank=True)
|
||||
@@ -5182,6 +5183,7 @@ class AccountRowerForm(ModelForm):
|
||||
'defaultlandingpage2',
|
||||
'defaultlandingpage3',
|
||||
'show_commutes',
|
||||
'small_commutes',
|
||||
'offercoaching', 'autojoin', 'emailalternatives']
|
||||
|
||||
widgets = {
|
||||
|
||||
+2
-2
@@ -1804,7 +1804,7 @@ def sigdig(value, digits=3):
|
||||
def handle_send_email_noinvoice(
|
||||
useremail, userfirstname, userlastname, reason, **kwargs):
|
||||
|
||||
subject = "Reason"
|
||||
subject = "Idoklad: No invoice created"
|
||||
|
||||
from_email = 'Rowsandall <admin@rowsandall.com>'
|
||||
d = {
|
||||
@@ -1813,7 +1813,7 @@ def handle_send_email_noinvoice(
|
||||
'reason': reason,
|
||||
}
|
||||
|
||||
_ = send_template_email(from_email, support@rowsandall.com, subject,
|
||||
_ = send_template_email(from_email, "support@rowsandall.com", subject,
|
||||
'paymentconfirmationemail_noinvoice.html',
|
||||
d, **kwargs)
|
||||
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
</h1>
|
||||
{% endif %}
|
||||
|
||||
{% if nr_commutes %}
|
||||
<p>
|
||||
<a href="?show_commutes=true">Show {{ nr_commutes }} commutes</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<ul class="main-content">
|
||||
<li class="grid_4">
|
||||
@@ -104,7 +109,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% 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">
|
||||
{% if request.GET.selectworkouts %}
|
||||
<input type="checkbox" id="workoutid" value={{ workout.id|encode }} name="workoutid" />
|
||||
@@ -202,7 +207,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% elif user.rower.show_commutes %}
|
||||
{% elif show_commutes and user.rower.small_commutes %}
|
||||
<li class="grid_4 divlines">
|
||||
<div class="workoutcontainer">
|
||||
<div class="workoutelement">
|
||||
|
||||
BIN
Binary file not shown.
@@ -2145,6 +2145,10 @@ def workouts_view(request, message='', successmessage='',
|
||||
request.session['referer'] = absolute(request)['PATH']
|
||||
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
|
||||
|
||||
startdate = datetime.datetime.combine(startdate, datetime.time())
|
||||
@@ -2264,9 +2268,13 @@ def workouts_view(request, message='', successmessage='',
|
||||
g_enddate = timezone.now()
|
||||
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)
|
||||
|
||||
|
||||
workoutsnohr = workouts.exclude(averagehr__isnull=False)
|
||||
for w in workoutsnohr: # pragma: no cover
|
||||
_ = dataprep.workout_trimp(w)
|
||||
@@ -2358,6 +2366,8 @@ def workouts_view(request, message='', successmessage='',
|
||||
'totalmeters': totalmeters,
|
||||
'totalminutes': totalminutes,
|
||||
'totalhours': totalhours,
|
||||
'nr_commutes': nr_commutes,
|
||||
'show_commutes': show_commutes,
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user