mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	Fix devalidation
This commit is contained in:
		@@ -111,6 +111,10 @@ class ConsumerSerializer(serializers.ModelSerializer):
 | 
			
		||||
        fields = '__all__'
 | 
			
		||||
 | 
			
		||||
    def get_note(self, obj):
 | 
			
		||||
        """
 | 
			
		||||
        Display information about the associated note
 | 
			
		||||
        """
 | 
			
		||||
        # If the user has no right to see the note, then we only display the note identifier
 | 
			
		||||
        if PermissionBackend.check_perm(get_current_authenticated_user(), "note.view_note", obj.note):
 | 
			
		||||
            print(obj.pk)
 | 
			
		||||
            return NotePolymorphicSerializer().to_representation(obj.note)
 | 
			
		||||
 
 | 
			
		||||
@@ -55,7 +55,7 @@ class HistoryTable(tables.Table):
 | 
			
		||||
                "class": lambda record: str(record.valid).lower() + ' validate',
 | 
			
		||||
                "data-toggle": "tooltip",
 | 
			
		||||
                "title": lambda record: _("Click to invalidate") if record.valid else _("Click to validate"),
 | 
			
		||||
                "onclick": lambda record: 'in_validate(' + str(record.id) + ', ' + str(record.valid).lower() + ')',
 | 
			
		||||
                "onclick": lambda record: 'de_validate(' + str(record.id) + ', ' + str(record.valid).lower() + ')',
 | 
			
		||||
                "onmouseover": lambda record: '$("#invalidity_reason_'
 | 
			
		||||
                                              + str(record.id) + '").show();$("#invalidity_reason_'
 | 
			
		||||
                                              + str(record.id) + '").focus();',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user