Commit d54c6372 authored by Zack Wong's avatar Zack Wong
Browse files

Merge remote-tracking branch 'origin/frekk-testing' into coffee-testing

parents f3731c4e 9fc650e8
......@@ -20,6 +20,16 @@ Stuff to do
- Automatic member account creation in Active Directory (after membership approved)
- Validating student numbers in ID field (also via email)
- Add dispense account balance online with Square paymentform
- Mailing list subscription management
- Change first name & last name to just "Real Name"
- then change display name to "Preferred name"
- delete sn & firstName attributes in AD
- Remove display name as editable field or make it only editable once it syncs with AD
- Actions to rightmost column
- Redirect to changelist
- Add reject membership button to admin actions
- Remove admin site banner / header & change colour scheme
- Pending memberships badge on admin index
Workflow Design
......@@ -15,6 +15,7 @@ if DISPENSE_BIN is None:
log.warning("DISPENSE_BIN is not defined! Lookups for prices will fallback to weird numbers (for testing)!")
def run_dispense(*args):
<<<<<<< HEAD
if DISPENSE_BIN is None:
return None
......@@ -63,3 +64,39 @@ def set_dispense_flag(user, flag, reason):
log.warning("set_dispense_flag: user was not updated with error: " + out)
return False;
return True;
if DISPENSE_BIN is None:
return None
cmd = (DISPENSE_BIN, ) + args"run_dispense: " + str(cmd))
# get a string containing the output of the program
res = subprocess.check_output(cmd, timeout=4, universal_newlines=True)
except CalledProcessError as e:
log.warning("dispense returned error code %d, output: '%s'" % (e.returncode, e.output))
return None
except TimeoutExpired as e:
return None
return res
def get_item_price(itemid):
""" gets the price of the given dispense item in cents """
if (itemid is None or itemid == ""):
return None
if DISPENSE_BIN is None:
return 2223
out = run_dispense('iteminfo', itemid)
if out is None:
return None
s = out.split() # get something like ['pseudo:7', '25.00', 'membership', '(non-student', 'and', 'non-guild)']
if (s[0] != itemid):
log.warning("get_item_price: got result for incorrect item: %s" + s)
return None
# return the price as a number of cents
return int(float(s[1]) * 100)
>>>>>>> origin/frekk-testing
Supports Markdown
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