Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hamza Touizrat
oser-backend
Commits
8a49368e
Commit
8a49368e
authored
Nov 13, 2022
by
salazard
Browse files
Options
Downloads
Patches
Plain Diff
rmv mail when registartate
parent
dd3260b3
No related branches found
No related tags found
1 merge request
!61
Verification mail
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
profiles/models.py
+1
-1
1 addition, 1 deletion
profiles/models.py
users/views.py
+22
-16
22 additions, 16 deletions
users/views.py
with
23 additions
and
17 deletions
profiles/models.py
+
1
−
1
View file @
8a49368e
...
@@ -194,7 +194,7 @@ class Student(ProfileMixin, models.Model):
...
@@ -194,7 +194,7 @@ class Student(ProfileMixin, models.Model):
self
.
year
=
f
"
{
date_now
.
year
-
1
}
/
{
date_now
.
year
}
"
self
.
year
=
f
"
{
date_now
.
year
-
1
}
/
{
date_now
.
year
}
"
# send email with link to registration docs
# send email with link to registration docs
SendDocs
(
user
=
self
.
user
).
send
()
#
SendDocs(user=self.user).send()
# send a telegram message to oserSECGEN
# send a telegram message to oserSECGEN
telegram_settings
=
settings
.
TELEGRAM
telegram_settings
=
settings
.
TELEGRAM
...
...
This diff is collapsed.
Click to expand it.
users/views.py
+
22
−
16
View file @
8a49368e
...
@@ -28,6 +28,7 @@ class UserViewSet(viewsets.ReadOnlyModelViewSet):
...
@@ -28,6 +28,7 @@ class UserViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class
=
UserSerializer
serializer_class
=
UserSerializer
permission_classes
=
(
DRYPermissions
,)
permission_classes
=
(
DRYPermissions
,)
class
UserCheckChartViewSet
(
APIView
):
class
UserCheckChartViewSet
(
APIView
):
"""
API endpoint that allows to see of user have signed charter.
"""
API endpoint that allows to see of user have signed charter.
...
@@ -37,23 +38,28 @@ class UserCheckChartViewSet(APIView):
...
@@ -37,23 +38,28 @@ class UserCheckChartViewSet(APIView):
list:
list:
Return a boolean value.
Return a boolean value.
"""
"""
def
get
(
self
,
*
args
,
**
kwargs
):
def
get
(
self
,
*
args
,
**
kwargs
):
user
=
User
.
objects
.
filter
(
email
=
self
.
request
.
query_params
.
get
(
'
email
'
))
user
=
User
.
objects
.
filter
(
email
=
self
.
request
.
query_params
.
get
(
'
email
'
))
print
(
self
.
request
.
query_params
.
get
(
'
email
'
))
try
:
if
user
[
0
].
HasSignedCharter
:
if
user
[
0
].
HasSignedCharter
:
resp
=
status
.
HTTP_200_OK
resp
=
status
.
HTTP_200_OK
else
:
else
:
resp
=
status
.
HTTP_40
4_NOT_FOUN
D
resp
=
status
.
HTTP_40
1_UNAUTHORIZE
D
return
Response
(
status
=
resp
)
return
Response
(
status
=
resp
)
except
IndexError
:
return
Response
(
status
=
status
.
HTTP_404_NOT_FOUND
)
def
post
(
self
,
*
args
,
**
kwargs
):
def
post
(
self
,
*
args
,
**
kwargs
):
user
=
User
.
objects
.
filter
(
email
=
self
.
request
.
query_params
.
get
(
'
email
'
))
print
(
self
.
request
.
query_params
.
get
(
'
email
'
))
user
=
User
.
objects
.
filter
(
email
=
self
.
request
.
query_params
.
get
(
'
email
'
))
if
len
(
user
)
!=
0
:
if
len
(
user
)
!=
0
:
resp
=
status
.
HTTP_200_OK
resp
=
status
.
HTTP_200_OK
else
:
resp
=
status
.
HTTP_404_NOT_FOUND
user
[
0
].
HasSignedCharter
=
True
user
[
0
].
HasSignedCharter
=
True
user
[
0
].
save
()
user
[
0
].
save
()
else
:
resp
=
status
.
HTTP_404_NOT_FOUND
return
Response
(
status
=
resp
)
return
Response
(
status
=
resp
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment