Commit da6d50e1 authored by Mario Chirinos's avatar Mario Chirinos

update.sh

parent 61d55639
...@@ -54,13 +54,14 @@ class Command(BaseCommand): ...@@ -54,13 +54,14 @@ class Command(BaseCommand):
publisherList = [ i for i in os.listdir(options['basedir'][0]) if os.path.isdir(i) ] publisherList = [ i for i in os.listdir(options['basedir'][0]) if os.path.isdir(i) ]
for p in publisherList: for p in publisherList:
print (p) print (p)
os.chdir(options['basedir'][0]+"/"+p+"/") curentdir = options['basedir'][0]+"/"+p+"/"
os.chdir(curentdir)
publisher = Publisher.objects.all().filter(shortName=p) publisher = Publisher.objects.all().filter(shortName=p)
print(os.getcwd()) print(os.getcwd())
if publisher.count()<=0 and os.path.isfile("settings.json") : if publisher.count()<=0 and os.path.isfile(curentdir+"settings.json") :
print(p, "do not exsist, crating publisher") print(p, "do not exsist, crating publisher")
with open('settings.json"', 'r') as f: with open(curentdir+'settings.json"', 'r') as f:
cfgfile = json.load(f) cfgfile = json.load(f)
newPublisher = Publisher() newPublisher = Publisher()
newPublisher.shortName=p newPublisher.shortName=p
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment