These are chat archives for django/django

1st
Oct 2018
Ahamed Musthafa
@amrs-tech
Oct 01 2018 05:21
Hi. Can anyone tell me how can I start contributing to django as a newcomer and how to become a member of this organization on GitHub
Luke-VideoLibre
@LukeVideo
Oct 01 2018 12:56
@amrs-tech the first rule of django is that the enswer is in the docs ;)
https://docs.djangoproject.com/en/dev/internals/contributing/
I am trying to get graphene to check that a field does not exist before continuing.
        try:
            profile_instance = document.user.profile
            if (document.consent):
                print("laurel")
            else:
                print("yany")
        except AssertionError:
            raise GraphQLError('The confirmation token is invalid')
But this breaks because the document doesn't have a consent yet. It's a one to one field.
Luke-VideoLibre
@LukeVideo
Oct 01 2018 13:05
So how can i check for a an object that may or may not exist
Frank Godo
@frankintrahouse
Oct 01 2018 13:14
@LukeVideo use if hasattr(document, 'consent'):
Luke-VideoLibre
@LukeVideo
Oct 01 2018 13:16
@frankintrahouse Thanks ! Saved my day !
Frank Godo
@frankintrahouse
Oct 01 2018 13:17
Happy to help
Ahamed Musthafa
@amrs-tech
Oct 01 2018 15:03
@LukeVideo Thanks :)