瀏覽代碼

Remove phone number field

https
jakobsn 6 年之前
父節點
當前提交
d776fd78ad
共有 4 個檔案被更改,包括 5 行新增7 行删除
  1. +0
    -1
      mysql/sql/init.sql
  2. +4
    -4
      src/app/models/register.py
  3. +0
    -1
      src/app/views/forms.py
  4. +1
    -1
      src/app/views/register.py

+ 0
- 1
mysql/sql/init.sql 查看文件

@@ -6,7 +6,6 @@ CREATE TABLE users (
full_name VARCHAR(200) NOT NULL, full_name VARCHAR(200) NOT NULL,
company VARCHAR(50), company VARCHAR(50),
email VARCHAR(50) NOT NULL, email VARCHAR(50) NOT NULL,
phone_number VARCHAR(50),
street_address VARCHAR(50), street_address VARCHAR(50),
city VARCHAR(50), city VARCHAR(50),
state VARCHAR(50), state VARCHAR(50),


+ 4
- 4
src/app/models/register.py 查看文件

@@ -8,7 +8,7 @@ def set_user(username, password, full_name, company, email, phone_number,
:param password: The password :param password: The password
:param full_name: The users full name :param full_name: The users full name
:param company: The company the user represents :param company: The company the user represents
:param phone_number: The phone number of the user
:param email: The users email address
:param street_address: The street address of the user :param street_address: The street address of the user
:param city: The city where the user lives :param city: The city where the user lives
:param state: The state where the user lives :param state: The state where the user lives
@@ -18,7 +18,7 @@ def set_user(username, password, full_name, company, email, phone_number,
:type password: str :type password: str
:type full_name: str :type full_name: str
:type company: str :type company: str
:type phone_number: str
:type email: str
:type street_address: str :type street_address: str
:type city: str :type city: str
:type state: str :type state: str
@@ -28,8 +28,8 @@ def set_user(username, password, full_name, company, email, phone_number,
cursor = db.cursor() cursor = db.cursor()
query = ("INSERT INTO users VALUES (NULL, \"" + username + "\", \"" + query = ("INSERT INTO users VALUES (NULL, \"" + username + "\", \"" +
password + "\", \"" + full_name + "\" , \"" + company + "\", \"" + password + "\", \"" + full_name + "\" , \"" + company + "\", \"" +
email + "\", \"" + phone_number + "\", \"" + street_address + "\", \"" +
city + "\", \"" + state + "\", \"" + postal_code + "\", \"" + country + "\")")
email + "\", \"" + street_address + "\", \"" + city + "\", \"" +
state + "\", \"" + postal_code + "\", \"" + country + "\")")
cursor.execute(query) cursor.execute(query)
db.commit() db.commit()
cursor.close() cursor.close()

+ 0
- 1
src/app/views/forms.py 查看文件

@@ -20,7 +20,6 @@ register_form = form.Form(
form.Textbox("full_name", description="Full name"), form.Textbox("full_name", description="Full name"),
form.Textbox("company", description="Company"), form.Textbox("company", description="Company"),
form.Textbox("email", vemail, description="Email Address"), form.Textbox("email", vemail, description="Email Address"),
form.Textbox("phone_number", description="Phone Number"),
form.Textbox("street_address", description="Street address"), form.Textbox("street_address", description="Street address"),
form.Textbox("city", description="City"), form.Textbox("city", description="City"),
form.Textbox("state", description="State"), form.Textbox("state", description="State"),


+ 1
- 1
src/app/views/register.py 查看文件

@@ -37,7 +37,7 @@ class Register:
return render.register(nav, r, "All fields must be valid.") return render.register(nav, r, "All fields must be valid.")


models.register.set_user(data.username, hashlib.md5(b'TDT4237' + data.password.encode('utf-8')).hexdigest(), models.register.set_user(data.username, hashlib.md5(b'TDT4237' + data.password.encode('utf-8')).hexdigest(),
data.full_name, data.email, data.company, data.phone_number, data.street_address,
data.full_name, data.company, data.phone_number, data.street_address,
data.city, data.state, data.postal_code, data.country) data.city, data.state, data.postal_code, data.country)
message += "User registered!" message += "User registered!"


Loading…
取消
儲存