summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'python/tbc_www/views.py')
-rw-r--r--python/tbc_www/views.py65
1 files changed, 46 insertions, 19 deletions
diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 29fb520..e5b92a0 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -32,7 +32,7 @@ def home(request):
pagerequest = 'home'
Lines = 10
TmpDict = default_TmpDict(pagerequest)
- TmpDict['EM'] = EbuildsMetadata.objects.filter(New = True).order_by('-Id')[:Lines]
+ TmpDict['EM'] = EbuildsMetadata.objects.order_by('-Id')[:Lines]
alist = []
for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
adict2 = {}
@@ -41,10 +41,23 @@ def home(request):
adict2['P'] = BL.EbuildId.PackageId.Package
adict2['V'] = BL.EbuildId.Version
adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo
- adict2['Fail'] = BL.Fail
adict2['SummeryText'] = BL.SummeryText
+ adict2['Fail'] = BL.Fail
if BL.Fail:
- adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ BE_tmp = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ for BE in BE_tmp:
+ if BE.ErrorId.ErrorId == 3:
+ adict2['FailCode'] = 'OTHERS'
+ if BE.ErrorId.ErrorId >= 4:
+ adict2['FailCode'] = BE.ErrorId.ErrorName
+ adict2['Repoman'] = False
+ BLRe = BuildLogsRepoman.objects.filter(BuildLogId = BL.BuildLogId)
+ if BLRe.exists():
+ adict2['Repoman'] = True
+ adict2['Qa'] = False
+ BLQe = BuildLogsQa.objects.filter(BuildLogId = BL.BuildLogId)
+ if BLQe.exists():
+ adict2['Qa'] = True
alist.append(adict2)
TmpDict['BL'] = alist
adict = {}
@@ -163,21 +176,22 @@ def ebuilds(request, package_id):
TmpDict['Bl'] = False
alist = []
for EM in TmpDict['EM_tmp']:
- adict = {}
- adict['EbuildId'] = EM.EbuildId.EbuildId
- adict['fail'] = False
BLe = BuildLogs.objects.filter(EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(EbuildId__Active = True)
- if BLe.filter(Fail = True).exists():
- adict['fail'] = True
- adict['repoman'] = False
- BLRe = BuildLogsRepoman.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True)
- if BLRe.exists():
- adict['repoman'] = True
- adict['qa'] = False
- BLQe = BuildLogsQa.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True)
- if BLQe.exists():
- adict['qa'] = True
- alist.append(adict)
+ if BLe.exists():
+ adict = {}
+ adict['EbuildId'] = EM.EbuildId.EbuildId
+ adict['fail'] = False
+ if BLe.filter(Fail = True).exists():
+ adict['fail'] = True
+ adict['repoman'] = False
+ BLRe = BuildLogsRepoman.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True)
+ if BLRe.exists():
+ adict['repoman'] = True
+ adict['qa'] = False
+ BLQe = BuildLogsQa.objects.filter(BuildLogId__EbuildId__EbuildId = EM.EbuildId.EbuildId).filter(BuildLogId__EbuildId__Active = True)
+ if BLQe.exists():
+ adict['qa'] = True
+ alist.append(adict)
TmpDict['fi_tmp'] = alist
return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', TmpDict)
@@ -202,7 +216,7 @@ def new_main(request):
pagerequest = 'new'
Lines = 30
TmpDict = default_TmpDict(pagerequest)
- TmpDict['EM'] = EbuildsMetadata.objects.filter(New = True).order_by('-Id')[:Lines]
+ TmpDict['EM'] = EbuildsMetadata.objects.order_by('-Id')[:Lines]
alist = []
for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
adict2 = {}
@@ -214,7 +228,20 @@ def new_main(request):
adict2['Fail'] = BL.Fail
adict2['SummeryText'] = BL.SummeryText
if BL.Fail:
- adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ BE_tmp = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ for BE in BE_tmp:
+ if BE.ErrorId.ErrorId == 3:
+ adict2['FailCode'] = 'OTHERS'
+ if BE.ErrorId.ErrorId >= 4:
+ adict2['FailCode'] = BE.ErrorId.Error
+ adict2['Repoman'] = False
+ BLRe = BuildLogsRepoman.objects.filter(BuildLogId = BL.BuildLogId)
+ if BLRe.exists():
+ adict2['Repoman'] = True
+ adict2['Qa'] = False
+ BLQe = BuildLogsQa.objects.filter(BuildLogId = BL.BuildLogId)
+ if BLQe.exists():
+ adict2['Qa'] = True
alist.append(adict2)
TmpDict['BL'] = alist
adict = {}