Skip to content

Commit

Permalink
college: Remove College Profiles App
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithpabbati committed Mar 29, 2020
1 parent 6477d58 commit 24d5f43
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ python:
install:
- pip install -r requirements.txt
script:
- python manage.py makemigrations debug attendance activity college members status tasks password registration utilities
- python manage.py makemigrations debug attendance activity members status tasks password registration utilities
- python manage.py migrate
- python manage.py test
Empty file removed college/__init__.py
Empty file.
17 changes: 0 additions & 17 deletions college/admin.py

This file was deleted.

39 changes: 0 additions & 39 deletions college/api/profile.py

This file was deleted.

5 changes: 0 additions & 5 deletions college/apps.py

This file was deleted.

28 changes: 0 additions & 28 deletions college/management/commands/import_student_profile.py

This file was deleted.

33 changes: 0 additions & 33 deletions college/models.py

This file was deleted.

5 changes: 0 additions & 5 deletions college/schema.py

This file was deleted.

3 changes: 1 addition & 2 deletions framework/api/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from members.models import Profile
from members.api.profile import ProfileObj
from status.models import Message
from college.models import Profile as CollegeProfile


class UserBasicObj(graphene.ObjectType):
Expand Down Expand Up @@ -49,7 +48,7 @@ def resolve_lastStatusUpdate(self, info):
return Message.objects.values().filter(member__username=self['username']).order_by('-date').first()['date']

def resolve_admissionYear(self, info):
return CollegeProfile.objects.values().get(user__username=self['username'])['admissionYear']
return Profile.objects.values().get(user__username=self['username'])['batch']

def resolve_profile(self, info):
return Profile.objects.values().get(user__username=self['username'])
8 changes: 0 additions & 8 deletions framework/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@
from graphene_django import DjangoObjectType

import attendance.schema
from college.schema import Query as collegeQuery
from dairy.schema import Query as dairyQuery
from registration.schema import Mutation as registrationMutation, Query as registrationQuery
import activity.schema
import tasks.schema
import status.schema
import password.schema
from .api.APIException import APIException
from college.api.profile import StudentProfileObj
from college.models import Profile as CollegeProfile
from dairy.schema import Mutation as eventMutation

from members.schema import Query as MembersQuery, Mutation as membersMutation
Expand Down Expand Up @@ -52,14 +49,10 @@ class UserObj(UserBasicObj, graphene.ObjectType):
)
isInLab = graphene.Boolean()
lastSeenInLab = graphene.types.datetime.DateTime()
collegeProfile = graphene.Field(StudentProfileObj)

def resolve_profile(self, info):
return Profile.objects.values().get(user__username=self['username'])

def resolve_collegeProfile(self, info):
return CollegeProfile.objects.values().get(user__username=self['username'])

@login_required
def resolve_groups(self, info):
return Group.objects.filter(members__username=self['username']).values()
Expand Down Expand Up @@ -207,7 +200,6 @@ def mutate(self, info, username=None, firstName=None, lastName=None, email=None,
class Query(
dairyQuery,
MembersQuery,
collegeQuery,
registrationQuery,
attendance.schema.Query,
activity.schema.Query,
Expand Down
1 change: 0 additions & 1 deletion framework/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
'members',
'attendance',
'activity',
'college.apps.CollegeConfig',
'dairy',
'status.apps.StatusConfig',
'registration',
Expand Down
3 changes: 1 addition & 2 deletions status/StatusUpdateReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pytz import timezone
import telegram
from status.models import Thread, DailyLog, Message, StatusException
from college.models import Profile
from members.models import Group
from members.models import Profile as UserProfile

Expand Down Expand Up @@ -58,7 +57,7 @@ def getBatchName(y):

@staticmethod
def groupMembersByBatch(members, year):
return Profile.objects.filter(user__in=members, admissionYear=year)
return UserProfile.objects.filter(user__in=members, batch=year)

@staticmethod
def getLastSendStr(last_send, expected_date):
Expand Down

0 comments on commit 24d5f43

Please sign in to comment.