Skip to content
Snippets Groups Projects
Select Git revision
  • 9df8d5d286de18026eafdd4ea9520b83d3cd74cd
  • dev default
  • 61-feature-add-optional-backwards-mapping-for-consistency-with-older-version
  • 61-feature-add-optional-backwards-mapping-for-consistency-with-older-version-2
  • main protected
  • 11-test-fix-tests-to-handle-licensed-data-resources-from-trud-snd-omop
  • general
  • pypi
  • old-main
  • v0.0.3
10 results

config3.yaml

Blame
    • mjbonifa's avatar
      9df8d5d2
      (fix) Changed the versioning of phenotypes to semantic versioning using the... · 9df8d5d2
      mjbonifa authored
      (fix) Changed the versioning of phenotypes to semantic versioning using the last tag in the repo rather than the commit count. The user can specify if they want to increment major, minor or patch when they publish which keeps the versioning simple. Previosuly we used the commit count but that was problematic due to always incrementing the patch versions and if using an existing the commit history could be large. This would especiually be the case when forking a repo where the commit history is retained. Closes #51
      9df8d5d2
      History
      (fix) Changed the versioning of phenotypes to semantic versioning using the...
      mjbonifa authored
      (fix) Changed the versioning of phenotypes to semantic versioning using the last tag in the repo rather than the commit count. The user can specify if they want to increment major, minor or patch when they publish which keeps the versioning simple. Previosuly we used the commit count but that was problematic due to always incrementing the patch versions and if using an existing the commit history could be large. This would especiually be the case when forking a repo where the commit history is retained. Closes #51
    social_auth.py 1.08 KiB
    """
    Module containing customisations to the Python Social Auth pipeline.
    
    See https://python-social-auth.readthedocs.io/en/latest/
    """
    
    from django.core.mail import mail_admins
    
    
    from social_core.pipeline.user import create_user
    
    
    def create_user_disabled(strategy, details, backend, user=None, *args, **kwargs):
        """
        Create a user account for the user being authenticated - but mark it as disabled.
    
        A new user must have their account enabled by an admin before they are able to log in.
        """
        # Returns dict containing 'is_new' and 'user'
        result = create_user(strategy, details, backend, user, *args, **kwargs)
    
        if result['is_new']:
            django_user = result['user']
            django_user.is_active = False
            django_user.save()
    
        return result
    
    
    def email_admins(strategy, details, backend, user=None, *args, **kwargs):
        """
        Email the PEDASI admins if a new account has been created and requires approval
        """
        if kwargs['is_new']:
            mail_admins(
                subject='PEDASI Account Created',
                message='User account created'
            )