forked from expo/troggle
[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.
This commit is contained in:
parent
e4ea57932e
commit
6d6991e266
@ -182,6 +182,11 @@ def LoadCaveTab():
|
|||||||
addToDefaultArgs(SurvexFile, "survex_file")
|
addToDefaultArgs(SurvexFile, "survex_file")
|
||||||
addToDefaultArgs(Notes, "notes")
|
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)
|
newCave, created=save_carefully(models.Cave, lookupAttribs=args, nonLookupAttribs=defaultArgs)
|
||||||
logging.info("Added cave "+str(newCave)+"\n")
|
logging.info("Added cave "+str(newCave)+"\n")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user