Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShakH00 committed Nov 10, 2024
2 parents 74c4089 + 36f9e58 commit 7ecc6a2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
10 changes: 9 additions & 1 deletion UserMethods.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@
###

class user:
def __init__(self, name, lastname, email, password,location, concern,documents=None, posts=None):
def __init__(self, name, lastname, email, password,location, concern, lawyer, lic=None, school=None, firm=None, documents=None, posts=None):
self.name = name
self.lastname = lastname
self.email = email
self.password = self.hash_password(password)
self.concern = concern
self.location = location
self.lawyer = lawyer
self.lic = lic
self.school = school if school is not None else None
self.firm = firm if firm is not None else None
self.documents = documents if documents is not None else []
self.posts = posts if posts is not None else []

Expand All @@ -47,6 +51,10 @@ def to_dict(self):
"password": self.password,
"location": self.location,
"concern": self.concern,
"lawyer": self.lawyer,
"license": self.lic,
"school": self.school,
"firm": self.firm,
"documents": self.documents,
"posts": self.posts

Expand Down
9 changes: 5 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ def register():
first = request.form.get('first')
last = request.form.get('last')
location = request.form.get('location')
lawyer = request.form.get('lawyer')
bar_num = request.form.get('bar')
school = request.form.get('school')
lawyer = request.form.getlist('lawyer-checkbox')
bar_num = request.form.get('license_id')
school = request.form.get('law_school')
firm = request.form.get('law_firm')
conc = "None"
new_person = user(first, last, email, pwd, location, conc)
new_person = user(first, last, email, pwd, location, conc, lawyer, bar_num, school, firm)
new_person.insert_doc()
# Simulate user registration
session['email'] = email # Log the user in after registration
Expand Down
2 changes: 2 additions & 0 deletions index/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ <h1>Welcome to the Registration Portal</h1>
<label for="law_firm">Law Firm <span class="required">*</span></label><br>
<input class="input input-msg" type="text" id="law_firm" name="law_firm" placeholder="Calgary Lawyers">
</div>

<p class="required-text"><span class="required">*</span> indicates a
required field</p>
<input class="submit-button" type="submit" value="Register">
</form>

</div>
</div>
<script src="../static/script.js"></script>
Expand Down

0 comments on commit 7ecc6a2

Please sign in to comment.