Skip to content
This repository was archived by the owner on Jun 4, 2019. It is now read-only.
This repository was archived by the owner on Jun 4, 2019. It is now read-only.

Simplify example/handlers.py AuthHandler._to_user_models_attrs #4

@erichiggins

Description

@erichiggins

Here's how I did it.

def _to_user_model_attrs(self, data, attrs_map):
  """Get the needed information from the provider dataset."""
  user_attrs = {}
  for k, v in attrs_map.iteritems():
    attr = (v, data.get(k)) if isinstance(v, str) else v(data.get(k))
    user_attrs.setdefault(*attr)

  return user_attrs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions