diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-06-10 17:47:05 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-06-10 17:47:05 +0100 |
commit | 6d6991e266a450699dc5f7e48bdaf2e9fbcf513d (patch) | |
tree | 45ef1e1e0184627390db9501f6791aa328a0c126 /parsers | |
parent | e4ea57932e18431b212543a6260cebdc74b9072a (diff) | |
download | troggle-6d6991e266a450699dc5f7e48bdaf2e9fbcf513d.tar.gz troggle-6d6991e266a450699dc5f7e48bdaf2e9fbcf513d.tar.bz2 troggle-6d6991e266a450699dc5f7e48bdaf2e9fbcf513d.zip |
[svn] Added detection of noinfo in cave parser. It sets the non_public flag to true, and the view then shows nonpublic.html instead of the cave if the user isn't logged in.
Diffstat (limited to 'parsers')
-rw-r--r-- | parsers/cavetab.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/parsers/cavetab.py b/parsers/cavetab.py index 3a990fe..dcc8fcc 100644 --- a/parsers/cavetab.py +++ b/parsers/cavetab.py @@ -182,6 +182,11 @@ def LoadCaveTab(): addToDefaultArgs(SurvexFile, "survex_file")
addToDefaultArgs(Notes, "notes")
+ #The following checks if this cave is non-public i.e. we don't have rights to display it online.
+ #Noinfo was the name of the old password protected directory, so if it has that then we will
+ #set the non_public field of the model instance to true.
+ defaultArgs["non_public"]=line[AutogenFile].startswith('noinfo') or line[LinkFile].startswith('noinfo')
+
newCave, created=save_carefully(models.Cave, lookupAttribs=args, nonLookupAttribs=defaultArgs)
logging.info("Added cave "+str(newCave)+"\n")
|