'Returns the image containing the mugshot for the user.
The mugshot can be a uploaded image or a Gravatar.
Gravatar functionality will only be used when
``USERENA_MUGSHOT_GRAVATAR`` is set to ``True``.
:return:
``None`` when Gravatar is not used and no default image is supplied
by ``USERENA_MUGSHOT_DEFAULT``.'

def get_mugshot_url(self):

    if self.mugshot:
        return self.mugshot.url
    if userena_settings.USERENA_MUGSHOT_GRAVATAR:
        return get_gravatar(self.user.email, userena_settings.USERENA_MUGSHOT_SIZE, userena_settings.USERENA_MUGSHOT_DEFAULT)
    elif (userena_settings.USERENA_MUGSHOT_DEFAULT not in ['404', 'mm', 'identicon', 'monsterid', 'wavatar']):
        return userena_settings.USERENA_MUGSHOT_DEFAULT
    else:
        return None
