-
+ {% endif %}
+ {% endif %}
-
Go to Chapter Page
{% endif %}
-
-
{% endblock %}
\ No newline at end of file
diff --git a/foundation/www/join_chapter.py b/foundation/www/join_chapter.py
index b5a6290d..bc9ba6ba 100644
--- a/foundation/www/join_chapter.py
+++ b/foundation/www/join_chapter.py
@@ -3,13 +3,20 @@ import frappe
def get_context(context):
context.no_cache = True
chapter = frappe.get_doc('Chapter', frappe.form_dict.name)
- print chapter
if frappe.session.user!='Guest':
if frappe.session.user in [d.user for d in chapter.members]:
context.already_member = True
else:
- chapter.append('members', dict(user=frappe.session.user))
- chapter.save(ignore_permissions=1)
- frappe.db.commit()
+ if frappe.request.method=='GET':
+ pass
+ elif frappe.request.method=='POST':
+ chapter.append('members', dict(
+ user=frappe.session.user,
+ introduction=frappe.form_dict.introduction,
+ website_url=frappe.form_dict.website_url,
+ enabled=1
+ ))
+ chapter.save(ignore_permissions=1)
+ frappe.db.commit()
context.chapter = chapter
diff --git a/foundation/www/user-intro.html b/foundation/www/user-intro.html
deleted file mode 100644
index 6777496f..00000000
--- a/foundation/www/user-intro.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{% extends "templates/web.html" %}
-
-{% block page_content %}
-
-
Go to Chapter Page
-
-{% endblock %}
\ No newline at end of file
diff --git a/foundation/www/user_intro.py b/foundation/www/user_intro.py
deleted file mode 100644
index c5926e1a..00000000
--- a/foundation/www/user_intro.py
+++ /dev/null
@@ -1,15 +0,0 @@
-import frappe
-
-def get_context(context):
- context.no_cache = True
- chapter = frappe.get_doc('Chapter', frappe.form_dict.name)
- print chapter
- if frappe.session.user!='Guest':
- if chapter in [d.name for d in chapter]:
- context.already_member = True
- else:
- chapter.append('members', dict(user=frappe.session.user))
- chapter.save(ignore_permissions=1)
- frappe.db.commit()
-
- context.chapter = chapter