Commit 70ec556b authored by Jean-samuel TETTEKPOE's avatar Jean-samuel TETTEKPOE
Browse files

Remove extra braces

parent d9dd0976
......@@ -13,3 +13,4 @@ venv/
bars_django/settings/prod.py
.admin_mdp
config_ldap.py
.vscode
......@@ -297,7 +297,6 @@ class AccountTests(APITestCase):
response = self.client.post('/account/?bar=avironjone', self.create_data)
self.assertEqual(response.status_code, 403)
def test_change_account(self):
# Unauthenticated
response = self.client.put('/account/%d/?bar=natationjone' % self.account.id, self.update_data)
......
......@@ -129,7 +129,7 @@ class ItemQtySerializer(serializers.Serializer):
total_price = 0
for (si, si_qty) in sellitem.calc_price_qty_per_stockitem():
print(("si " + str(si) + " " + str(qty)))
print("si " + str(si) + " " + str(qty))
delta = si_qty * qty
si.create_operation(delta=-delta, unit='sell', transaction=t, fuzzy=True)
total_price += delta * si.get_price(unit='sell')
......
......@@ -88,9 +88,9 @@ class BasicImportHelper(object):
except:
print("---------------")
print("Error saving the following object:")
print((the_obj.__class__))
print(the_obj.__class__)
print(" ")
print((the_obj.__dict__))
print(the_obj.__dict__)
print(" ")
print(the_obj)
print(" ")
......
......@@ -80,7 +80,7 @@ def get_section(section):
for dn, attrs in l.search_s('dc=eleves,dc=polytechnique,dc=fr',ldap.SCOPE_SUBTREE,'(&(memberOf=cn=promo_x{0},ou=groups,dc=eleves,dc=polytechnique,dc=fr)(memberOf=cn=sport_{1},ou=groups,dc=eleves,dc=polytechnique,dc=fr)(!(adminOf=cn=promo_x{0},ou=groups,dc=eleves,dc=polytechnique,dc=fr)))'.format(PROMO, section), _attrs):
for attr in _attrs:
if attr not in attrs:
print(("WARNING : {} n'a pas de {}".format(dn, attr)))
print("WARNING : {} n'a pas de {}".format(dn, attr))
break
else:
yield {attr: attrs[attr][0].decode("utf8", errors="replace") for attr in _attrs}
......@@ -107,7 +107,7 @@ def run():
for barid, sections in list(BARS.items()):
bar = Bar(id=barid+COULEUR_, name="{} {}".format("−".join(map(str.title, sections)), COULEUR.title()))
eval(input("Création du bar suivant ?\n"+bar.name+" contenant "+sections[0]+"\nIl est encore temps d'appuyer sur ^C ! Appuyer sur entree pour continuer : "))
print(("Creation de {}".format(bar.name)))
print("Creation de {}".format(bar.name))
bar.save()
for section in sections:
for tos in get_section(section):
......@@ -117,20 +117,20 @@ def run():
for barid, sections in list(BARS_LINK.items()):
bar = Bar.objects.get(id=barid)
eval(input("Ajout des utilisateurs dans le bar suivant ?\n"+bar.name+" contenant "+sections[0]+"\nIl est encore temps d'appuyer sur ^C ! Appuyer sur entree pour continuer : "))
print(("Peuplement de {}".format(bar.name)))
print("Peuplement de {}".format(bar.name))
for section in sections:
for tos in get_section(section):
try:
add_to_bar(tos, bar)
except:
print(("Erreur : {0} existe déjà dans ce bar".format(tos["uid"])))
print("Erreur : {0} existe déjà dans ce bar".format(tos["uid"]))
def add_to_bar(user, bar):
try:
tos = User.objects.get(Q(email=user["email"]) | Q(username=user["uid"]))
print(("{} existe déjà".format(user["uid"])))
print("{} existe déjà".format(user["uid"]))
except User.DoesNotExist:
print(("Création de {}".format(user["uid"])))
print("Création de {}".format(user["uid"]))
tos = User.objects.create_user(user["uid"], PASSWORD)
tos.pseudo = user["uid"]
tos.firstname = user["givenName"]
......
......@@ -16,8 +16,8 @@ def run():
bip.save()
except IndexError:
print("ERROR !")
print(("Bar : %s" % bar))
print(("Aliment : %s" % bip.buyitem.details.name))
print(("BuyItemPrice : %d" % bip.id))
print(("BuyItem : %d" % bip.buyitem.id))
print(("ItemDetails : %d" % bip.buyitem.details.id))
print("Bar : %s" % bar)
print("Aliment : %s" % bip.buyitem.details.name)
print("BuyItemPrice : %d" % bip.id)
print("BuyItem : %d" % bip.buyitem.id)
print("ItemDetails : %d" % bip.buyitem.details.id)
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