community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1706208 - /comdev/reporter.apache.org/trunk/site/getjson.py
Date Thu, 01 Oct 2015 09:36:41 GMT
Author: sebb
Date: Thu Oct  1 09:36:41 2015
New Revision: 1706208

URL: http://svn.apache.org/viewvc?rev=1706208&view=rev
Log:
Only read the data if the id is valid

Modified:
    comdev/reporter.apache.org/trunk/site/getjson.py

Modified: comdev/reporter.apache.org/trunk/site/getjson.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/getjson.py?rev=1706208&r1=1706207&r2=1706208&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/getjson.py (original)
+++ comdev/reporter.apache.org/trunk/site/getjson.py Thu Oct  1 09:36:41 2015
@@ -193,25 +193,19 @@ def getReleaseData(project):
         return {}
 
 
-
-pchanges = {}
-cchanges = {}
-
-with open("/var/www/reporter.apache.org/data/pmcs.json", "r") as f:
-    pchanges = json.loads(f.read())
-    f.close()
-
-with open("/var/www/reporter.apache.org/data/projects.json", "r") as f:
-    cchanges = json.loads(f.read())
-    f.close()
-
-
 user = os.environ['HTTP_X_AUTHENTICATED_USER'] if 'HTTP_X_AUTHENTICATED_USER' in os.environ
else ""
 m = re.match(r"^([-a-zA-Z0-9_.]+)$", user)
-groups = []
 
-cdata = {}
 if m:
+    pchanges = {}
+    cchanges = {}
+    with open("/var/www/reporter.apache.org/data/pmcs.json", "r") as f:
+        pchanges = json.loads(f.read())
+        f.close()
+    
+    with open("/var/www/reporter.apache.org/data/projects.json", "r") as f:
+        cchanges = json.loads(f.read())
+        f.close()
     uid = m.group(1)
     groups = getPMCs(uid)
     include = os.environ['QUERY_STRING'] if 'QUERY_STRING' in os.environ else None
@@ -246,6 +240,7 @@ if m:
                 emails[tlp] = emails[tlp] if tlp in emails else {}
                 emails[tlp][nentry] = mld[entry]
     jdata = {}
+    cdata = {}
     ddata = {}
     rdata = {}
     allpmcs = []



Mime
View raw message