refactor, stage 1
This commit is contained in:
@@ -10,6 +10,7 @@ from rowers.utils import (
|
||||
# for actions related to uploads
|
||||
from django.conf import settings
|
||||
from django.utils import timezone, translation
|
||||
|
||||
from rowers.tasks import (
|
||||
handle_sendemail_unrecognized, handle_sendemailnewcomment,
|
||||
handle_sendemailnewresponse, handle_updatedps,
|
||||
@@ -17,7 +18,7 @@ from rowers.tasks import (
|
||||
handle_sendemailcsv
|
||||
)
|
||||
|
||||
from rowers.models import GraphImage, SyncRecord
|
||||
from rowers.models import GraphImage, create_or_update_syncrecord
|
||||
|
||||
from rowers.rower_rules import ispromember
|
||||
from rowers.utils import dologging
|
||||
@@ -148,11 +149,7 @@ def do_sync(w, options, quick=False):
|
||||
if options['nkid'] != 0 and options['nkid'] != '': # pragma: no cover
|
||||
w.uploadedtonk = options['nkid']
|
||||
w.save()
|
||||
record = SyncRecord(workout=w,nkid=options['nkid'])
|
||||
try:
|
||||
record.save()
|
||||
except:
|
||||
pass
|
||||
record = create_or_update_syncrecord(w.user, w, {nkid:options['nkid']})
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
@@ -187,11 +184,7 @@ def do_sync(w, options, quick=False):
|
||||
# upload_to_c2 = False
|
||||
do_c2_export = False
|
||||
w.save()
|
||||
record = SyncRecord(workout=w,c2id=options['c2id'])
|
||||
try:
|
||||
record.save()
|
||||
except:
|
||||
pass
|
||||
record = create_or_update_syncrecord(w.user, w, {c2id:options['c2id']})
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user