Skip to content

Commit

Permalink
registration: Fix issue in getApplicant API
Browse files Browse the repository at this point in the history
- Returns the first application
  • Loading branch information
harshithpabbati committed Feb 15, 2020
1 parent 07f5084 commit 6c0997b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions registration/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def mutate(self, info, formID, name, email=None, phone=None, formData=None):
class rsvpResponseObj(graphene.ObjectType):
status = graphene.String()


class submitRSVP(graphene.Mutation):
class Arguments:
response = graphene.Boolean(required=True)
Expand Down Expand Up @@ -146,7 +147,8 @@ def mutate(self, info, appID):
form = app.form
if form.enableCheckIn:
if app.checkIn:
raise APIException('The person has already checked-in at ' + str(app.checkInTime), code='ALREADY_CHECKED_IN')
raise APIException('The person has already checked-in at ' + str(app.checkInTime),
code='ALREADY_CHECKED_IN')
else:
app.checkIn = True
app.checkInTime = datetime.now()
Expand Down Expand Up @@ -267,7 +269,7 @@ def resolve_sendRSVPEmail(self, info, **kwargs):
def resolve_getApplicant(self, info, **kwargs):
hashCode = kwargs.get('hash')
try:
app = Application.objects.values().get(hash=hashCode)
app = Application.objects.values().filter(hash=hashCode).first()
except ObjectDoesNotExist:
raise APIException("Person not found in the database", code="NOT_FOUND")
return app

0 comments on commit 6c0997b

Please sign in to comment.