Commit a7ea5e44 authored by Mario Chirinos's avatar Mario Chirinos

update db

parent de5b5a9f
...@@ -60,8 +60,8 @@ class Command(BaseCommand): ...@@ -60,8 +60,8 @@ class Command(BaseCommand):
os.chdir(curentdir) 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:
if os.path.isfile("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('settings.json', 'r') as f:
cfgfile = json.load(f) cfgfile = json.load(f)
...@@ -73,6 +73,8 @@ class Command(BaseCommand): ...@@ -73,6 +73,8 @@ class Command(BaseCommand):
newPublisher.type="texto" newPublisher.type="texto"
newPublisher.save() newPublisher.save()
publisher = Publisher.objects.all().filter(shortName=p) publisher = Publisher.objects.all().filter(shortName=p)
else:
print("settings.json not found")
else: else:
publisher=publisher[0] publisher=publisher[0]
print(publisher) print(publisher)
......
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