Skip to content

Commit

Permalink
Merge branch 'ps_1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
arielfayol37 authored Dec 5, 2023
2 parents 01389f5 + c6d121d commit 7f9a2a1
Show file tree
Hide file tree
Showing 34 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion astros/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def all_courses(request):
@login_required(login_url='astros:login')
def course_enroll(request, course_id, code):
# Making sure the request is done by a Student.
student = get_object_or_404(Student, pk=request.user.pk)
try:
student = get_object_or_404(Student, pk=request.user.pk)
except:
return HttpResponse(json.dumps({'state':False, 'response': 'LOGIN FIRST'}))
course = get_object_or_404(Course, pk = course_id)
if not Enrollment.objects.filter(student=student, course=course).exists():
# Checking whether code is valid.
Expand Down
Binary file added db.sqlite3
Binary file not shown.
5 changes: 5 additions & 0 deletions deimos/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,11 @@ def register(request):
username = str(username) + str(random.randint(1, 1000000))
except:
pass # if profile with this username does not exists.
try:
s = Student.objects.get(username=username)
username = str(username) + str(random.randint(1, 10000000))
except Student.DoesNotExist:
pass
try:
checking_student = Student.objects.get(email=email)
if checking_student:
Expand Down
Binary file added media/20231119_195754.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/Embid.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/aii.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/deimos/images/notes_images/download.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/deimos/images/notes_images/mcc.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/deimos/images/notes_images/mount_fako.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/deimos/images/notes_images/rema.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/embid.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/phobos/images/course_covers/ai.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/phobos/images/course_covers/download_1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/phobos/images/question_images/ahidjo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/phobos/images/question_images/cameroon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/phobos/images/question_images/fally_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/phobos/images/question_images/paul.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/phobos/images/question_images/rema.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/phobos/images/question_images/salah.jpg
Binary file added media/phobos/images/question_images/wave.jfif
Binary file not shown.
Binary file added media/phobos/images/question_images/wizkid.jpg
Binary file added media/zym83jwwa4e61.png
1 change: 1 addition & 0 deletions phobos/migrations/0050_alter_course_subject.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by Django 4.2.3 on 2023-12-03 05:10


from django.db import migrations, models


Expand Down
3 changes: 3 additions & 0 deletions run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python manage.py makemigrations
python manage.py migrate
python manage.py runserver 0.0.0.0:8000

0 comments on commit 7f9a2a1

Please sign in to comment.