Changeset - 8605b0c3c489
[Not reviewed]
default
0 1 0
Dennis Fink - 3 years ago 2022-01-19 20:43:40
dennis.fink@c3l.lu
Set voting flag with ternary expression
1 file changed with 1 insertions and 5 deletions:
0 comments (0 inline, 0 general)
c3l_membership/views.py
Show inline comments
 
@@ -62,17 +62,12 @@ def index():
 
            price = current_app.config["SUPPORTING_FEE"]
 
        elif form.starving.data:
 
            price = 1
 
        else:
 
            price = current_app.config["REGULAR_FEE"]
 

	
 
        if form.membership.data == "supporting":
 
            xml_data["voting"] = 0
 
        elif form.membership.data == "regular":
 
            xml_data["voting"] = 1
 

	
 
        if form.starving.data:
 
            status = "Starving"
 
        elif form.minor_member.data or form.student.data:
 
            status = "Student"
 
        elif form.membership.data == "supporting":
 
            status = "Supporter"
 
@@ -93,12 +88,13 @@ def index():
 
                form.city.data,
 
                form.state.data,
 
                form.country.data,
 
            )
 
        )
 
        xml_data["address"] = re.sub("\s+", " ", xml_data["address"])
 
        xml_data["voting"] = 1 if form.membership.data == "regular" else 0
 

	
 
        if form.payment.data in current_app.config["CRYPTOCURRENCIES"]:
 

	
 
            current_conversion_r = requests.get(
 
                current_app.config["CONVERSION_URL"], timeout=30
 
            )
0 comments (0 inline, 0 general)