1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
This commit is contained in:
Stefan Pratter
2018-11-09 10:18:23 +00:00
parent e3ab24d19d
commit 45a272a7a5
2 changed files with 6 additions and 8 deletions

View File

@@ -115,7 +115,7 @@ You can populate your data from peeringdb.com using
However be prepared for this to take 15-20 minutes as it will not only sync the entities, but also set up usergroups for each organization and so forth.
This can only be used to populate initial data. Once you have started adding / updating objects and your data diverges from production data, it is no longer useful to call this command nor will it allow you to.
This should only be used to populate initial data. Once you have started adding / updating objects and your data diverges from production data, it is no longer useful to call this command.
Special Note: this will only sync data visible to everyone, any fields or rows hidden behind authentication will be missed.

View File

@@ -47,6 +47,11 @@ def sync_obj(cls, row):
print(obj, obj.id)
try:
# we want to validate because it fixes some values
# but at the same time we don't care about any validation
# errors, since we can assume that the data from the
# server is already valid, nor do we want to block import
# because our validators differ from the servers.
obj.full_clean()
except ValidationError as e:
pass
@@ -100,11 +105,4 @@ class Command(BaseCommand):
pdb_models.NetworkIXLan
]
for model in djpdb_models.all_models:
count = model.objects.all().count()
if count > 0:
self.stdout.write("This command should only be called on an empty database")
self.stdout.write("We already found {} {} in the database, aborting.".format(count, model))
return
call_command("pdb_sync")