from __future__ import absolute_import

from sentry.api.serializers import Serializer, register
from sentry.models import OrganizationMember


@register(OrganizationMember)
class OrganizationMemberSerializer(Serializer):
    def serialize(self, obj, attrs, user):
        d = {
            'id': str(obj.id),
            'email': obj.email or obj.user.email,
            'access': obj.get_type_display(),
            'pending': obj.is_pending,
            'dateCreated': obj.date_added,
        }
        return d

from __future__ import absolute_import

from sentry.api.serializers import Serializer, register
from sentry.models import OrganizationMember
from sentry.utils.avatar import get_gravatar_url


@register(OrganizationMember)
class OrganizationMemberSerializer(Serializer):
    def serialize(self, obj, attrs, user):
        d = {
            'id': str(obj.id),
            'email': obj.email or obj.user.email,
            'access': obj.get_type_display(),
            'pending': obj.is_pending,
            'dateCreated': obj.date_added,
            'avatarUrl': get_gravatar_url(obj.email, size=32),
        }
        return d

Add avatarUrl to team member serializers
Add avatarUrl to team member serializers

Conflicts:
	src/sentry/api/serializers/models/organization_member.py
	src/sentry/api/serializers/models/release.py

cherry-pick 8ee1bee748ae7f51987ea8ec5ee10795b656cfd9

  from __future__ import absolute_import
  
  from sentry.api.serializers import Serializer, register
  from sentry.models import OrganizationMember
+ from sentry.utils.avatar import get_gravatar_url
  
  
  @register(OrganizationMember)
  class OrganizationMemberSerializer(Serializer):
      def serialize(self, obj, attrs, user):
          d = {
              'id': str(obj.id),
              'email': obj.email or obj.user.email,
              'access': obj.get_type_display(),
              'pending': obj.is_pending,
              'dateCreated': obj.date_added,
+             'avatarUrl': get_gravatar_url(obj.email, size=32),
          }
          return d
  
Add avatarUrl to team member serializers
## Code Before:
from __future__ import absolute_import

from sentry.api.serializers import Serializer, register
from sentry.models import OrganizationMember


@register(OrganizationMember)
class OrganizationMemberSerializer(Serializer):
    def serialize(self, obj, attrs, user):
        d = {
            'id': str(obj.id),
            'email': obj.email or obj.user.email,
            'access': obj.get_type_display(),
            'pending': obj.is_pending,
            'dateCreated': obj.date_added,
        }
        return d

## Instruction:
Add avatarUrl to team member serializers
## Code After:
from __future__ import absolute_import

from sentry.api.serializers import Serializer, register
from sentry.models import OrganizationMember
from sentry.utils.avatar import get_gravatar_url


@register(OrganizationMember)
class OrganizationMemberSerializer(Serializer):
    def serialize(self, obj, attrs, user):
        d = {
            'id': str(obj.id),
            'email': obj.email or obj.user.email,
            'access': obj.get_type_display(),
            'pending': obj.is_pending,
            'dateCreated': obj.date_added,
            'avatarUrl': get_gravatar_url(obj.email, size=32),
        }
        return d
