Fixed issues in getSeason()
This commit is contained in:
@@ -150,15 +150,26 @@ def getSeason(request, ls, season):
|
|||||||
season = ol.getSeason(str(season), ls)
|
season = ol.getSeason(str(season), ls)
|
||||||
md = get_current_md(ls)
|
md = get_current_md(ls)
|
||||||
|
|
||||||
|
return_vals = []
|
||||||
for team in teams[0]:
|
for team in teams[0]:
|
||||||
t = Team(
|
t = Team(
|
||||||
teamID=team['teamID'],
|
teamID=team['teamID'],
|
||||||
name=team['teamName'],
|
name=team['teamName'],
|
||||||
iconURL = team['teamIconURL']
|
iconURL = team['teamIconURL']
|
||||||
)
|
)
|
||||||
if t.teamID is None:
|
|
||||||
|
"""
|
||||||
|
check if object exits and do insert if not
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
to = Team.objects.get(teamID=int(t.teamID))
|
||||||
|
except Team.DoesNotExist:
|
||||||
t.save()
|
t.save()
|
||||||
|
|
||||||
|
if to.iconURL is None:
|
||||||
|
t.save(update_fields=['iconURL'])
|
||||||
|
|
||||||
|
|
||||||
for match in season[0]:
|
for match in season[0]:
|
||||||
m = Match(matchID=unicode(match['matchID']),
|
m = Match(matchID=unicode(match['matchID']),
|
||||||
matchDateTime=datetime.strptime(
|
matchDateTime=datetime.strptime(
|
||||||
@@ -626,7 +637,7 @@ def get_current_md(ls):
|
|||||||
return(cur_md['groupOrderID'])
|
return(cur_md['groupOrderID'])
|
||||||
|
|
||||||
def get_current_ls():
|
def get_current_ls():
|
||||||
return("em2016")
|
return("bl1")
|
||||||
|
|
||||||
def get_current_season():
|
def get_current_season():
|
||||||
return("2016")
|
return("2016")
|
||||||
|
|||||||
Reference in New Issue
Block a user