imran-cloud-erp-auth 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- imran_cloud_erp_auth-0.1.0/PKG-INFO +5 -0
- imran_cloud_erp_auth-0.1.0/README.md +1 -0
- imran_cloud_erp_auth-0.1.0/cloud_erp_auth/__init__.py +1 -0
- imran_cloud_erp_auth-0.1.0/cloud_erp_auth/services.py +37 -0
- imran_cloud_erp_auth-0.1.0/cloud_erp_auth/validators.py +0 -0
- imran_cloud_erp_auth-0.1.0/cloud_erp_auth/views.py +0 -0
- imran_cloud_erp_auth-0.1.0/imran_cloud_erp_auth.egg-info/PKG-INFO +5 -0
- imran_cloud_erp_auth-0.1.0/imran_cloud_erp_auth.egg-info/SOURCES.txt +12 -0
- imran_cloud_erp_auth-0.1.0/imran_cloud_erp_auth.egg-info/dependency_links.txt +1 -0
- imran_cloud_erp_auth-0.1.0/imran_cloud_erp_auth.egg-info/requires.txt +1 -0
- imran_cloud_erp_auth-0.1.0/imran_cloud_erp_auth.egg-info/top_level.txt +1 -0
- imran_cloud_erp_auth-0.1.0/pyproject.toml +0 -0
- imran_cloud_erp_auth-0.1.0/setup.cfg +4 -0
- imran_cloud_erp_auth-0.1.0/setup.py +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This is ERP system Website which is Developed in Python and Django
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .services import register_user
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from django.contrib.auth.models import User
|
|
2
|
+
from .models import UserProfile # optional if reusable
|
|
3
|
+
|
|
4
|
+
def register_user(data):
|
|
5
|
+
full_name = data.get("full_name")
|
|
6
|
+
email = data.get("email")
|
|
7
|
+
username = data.get("username")
|
|
8
|
+
password = data.get("password")
|
|
9
|
+
confirm_password = data.get("confirm_password")
|
|
10
|
+
question = data.get("question")
|
|
11
|
+
answer = data.get("answer")
|
|
12
|
+
|
|
13
|
+
if not all([full_name, email, username, password, confirm_password, question, answer]):
|
|
14
|
+
return {"error": "All fields are required"}
|
|
15
|
+
|
|
16
|
+
if password != confirm_password:
|
|
17
|
+
return {"error": "Passwords do not match"}
|
|
18
|
+
|
|
19
|
+
if User.objects.filter(username=username).exists():
|
|
20
|
+
return {"error": "Username already exists"}
|
|
21
|
+
|
|
22
|
+
if User.objects.filter(email=email).exists():
|
|
23
|
+
return {"error": "Email already registered"}
|
|
24
|
+
|
|
25
|
+
user = User.objects.create_user(
|
|
26
|
+
username=username, password=password, email=email
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
UserProfile.objects.create(
|
|
30
|
+
user=user,
|
|
31
|
+
full_name=full_name,
|
|
32
|
+
email=email,
|
|
33
|
+
security_question=question,
|
|
34
|
+
security_answer=answer,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
return {"success": True, "user": user}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
setup.py
|
|
4
|
+
cloud_erp_auth/__init__.py
|
|
5
|
+
cloud_erp_auth/services.py
|
|
6
|
+
cloud_erp_auth/validators.py
|
|
7
|
+
cloud_erp_auth/views.py
|
|
8
|
+
imran_cloud_erp_auth.egg-info/PKG-INFO
|
|
9
|
+
imran_cloud_erp_auth.egg-info/SOURCES.txt
|
|
10
|
+
imran_cloud_erp_auth.egg-info/dependency_links.txt
|
|
11
|
+
imran_cloud_erp_auth.egg-info/requires.txt
|
|
12
|
+
imran_cloud_erp_auth.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
django
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cloud_erp_auth
|
|
File without changes
|