mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-15 19:19:42 +00:00
Fixed a slight issue with string formatting in import_venue
This commit is contained in:
@@ -14,6 +14,7 @@ from RIGS import models
|
||||
import reversion
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
def setup_cursor():
|
||||
try:
|
||||
cursor = connections['legacy'].cursor()
|
||||
@@ -99,7 +100,7 @@ def import_venues(delete=False):
|
||||
sql = """SELECT `venue`, `threephasepower` FROM `eventdetails` WHERE `venue` IS NOT NULL"""
|
||||
cursor.execute(sql)
|
||||
for row in cursor.fetchall():
|
||||
print("Searching for %s", row[0])
|
||||
print(("Searching for %s", row[0]))
|
||||
try:
|
||||
object = models.Venue.objects.get(name__iexact=row[0])
|
||||
if not object.three_phase_available and row[1]:
|
||||
@@ -111,11 +112,13 @@ def import_venues(delete=False):
|
||||
object = models.Venue(name=row[0], three_phase_available=row[1])
|
||||
object.save()
|
||||
|
||||
|
||||
def main():
|
||||
# import_people()
|
||||
# import_organisations()
|
||||
# import_vat_rates()
|
||||
import_venues(True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user