Rammohan0504 commited on
Commit
7dfdd45
·
verified ·
1 Parent(s): e77824b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -34,6 +34,11 @@ print("Session interface configured.")
34
  def home():
35
  return render_template("index.html")
36
 
 
 
 
 
 
37
  @app.route("/signup", methods=["GET", "POST"])
38
  def signup():
39
  if request.method == "POST":
@@ -49,6 +54,7 @@ def signup():
49
  "Email__c": email,
50
  "Password__c": password,
51
  "Referral__c": referral
 
52
  })
53
  return redirect(url_for("login"))
54
  except Exception as e:
 
34
  def home():
35
  return render_template("index.html")
36
 
37
+ def generate_referral_code(length=8):
38
+ """Generate a random alphanumeric referral code."""
39
+ return ''.join(random.choices(string.ascii_uppercase + string.digits, k=length))
40
+
41
+
42
  @app.route("/signup", methods=["GET", "POST"])
43
  def signup():
44
  if request.method == "POST":
 
54
  "Email__c": email,
55
  "Password__c": password,
56
  "Referral__c": referral
57
+ "Customer_Referral_Code__c": referral_code
58
  })
59
  return redirect(url_for("login"))
60
  except Exception as e: