
    ^'i                     ^    d dl mZ d dlmZ ddlmZ  ej                  d      d        Zd Z	y)	    )checks)gettext_lazy   )settings	constancec                      t        t        d      rWt        j                  rGt               }|r;t	        j
                  t        d      dj                  t        |            dd      gS g S )z
    A Django system check to make sure that, if defined, CONFIG_FIELDSETS accounts for
    every entry in settings.CONFIG.
    CONFIG_FIELDSETSzOCONSTANCE_CONFIG_FIELDSETS is missing field(s) that exists in CONSTANCE_CONFIG.z, zsettings.CONSTANCE_CONFIGzconstance.E001)hintobjid)	hasattrr   r	   get_inconsistent_fieldnamesr   Warning_joinsorted)argskwargsinconsistent_fieldnamess      /opt/sopds/constance/checks.pycheck_fieldsetsr      sh     x+,1J1J"="?"D 6*A#BC3'
 
 I    c                     g } t         j                  j                         D ]  \  }}|D ]  }| j                  |         | si S t	        t	        t         j
                  j                               t	        |       z
        S )z
    Returns a set of keys from settings.CONFIG that are not accounted for in
    settings.CONFIG_FIELDSETS.
    If there are no fieldnames in settings.CONFIG_FIELDSETS, returns an empty set.
    )r   r	   itemsappendsetCONFIGkeys)field_name_listfieldset_titlefields_list
field_names       r   r   r      sz     O'/'@'@'F'F'H /#% 	/J"":.	// 	s8??'')*S-AABBr   N)
django.corer   django.utils.translationr   r    r   registerr   r    r   r   <module>r(      s3     6   ,Cr   