mirror of
				https://gitlab.crans.org/mediatek/med.git
				synced 2025-11-04 02:12:09 +01:00 
			
		
		
		
	Pipelines
This commit is contained in:
		@@ -82,11 +82,13 @@ class MediaAdminForm(ModelForm):
 | 
			
		||||
            if field.disabled:
 | 
			
		||||
                value = self.get_initial_for_field(field, name)
 | 
			
		||||
            else:
 | 
			
		||||
                value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))
 | 
			
		||||
                value = field.widget.value_from_datadict(
 | 
			
		||||
                    self.data, self.files, self.add_prefix(name))
 | 
			
		||||
            from django.core.exceptions import ValidationError
 | 
			
		||||
            try:
 | 
			
		||||
                # We don't want to check a field when we enter an ISBN.
 | 
			
		||||
                if "_continue" not in self.request.POST or not self.cleaned_data.get('isbn'):
 | 
			
		||||
                if "_continue" not in self.request.POST \
 | 
			
		||||
                        or not self.cleaned_data.get('isbn'):
 | 
			
		||||
                    value = field.clean(value)
 | 
			
		||||
                self.cleaned_data[name] = value
 | 
			
		||||
                if hasattr(self, 'clean_%s' % name):
 | 
			
		||||
 
 | 
			
		||||
@@ -91,7 +91,7 @@ class BedetequeScraper:
 | 
			
		||||
 | 
			
		||||
        # Get author and illustrator
 | 
			
		||||
        author = re.search(regex_author, content)
 | 
			
		||||
        if not 'author' in data:
 | 
			
		||||
        if 'author' not in data:
 | 
			
		||||
            data['author'] = list()
 | 
			
		||||
        if author:
 | 
			
		||||
            data['author'].append(author.group(1))
 | 
			
		||||
@@ -100,9 +100,10 @@ class BedetequeScraper:
 | 
			
		||||
            data['author'].append(illustrator.group(1))
 | 
			
		||||
 | 
			
		||||
        author_name = data['author'][0]
 | 
			
		||||
        if ',' not in author_name:
 | 
			
		||||
        if ',' not in author_name and ' ' in author_name:
 | 
			
		||||
            author_name = author_name.split(' ')[1]
 | 
			
		||||
        side_identifier = "{:.3} {:.3}".format(author_name.upper(), data['title'].upper(),)
 | 
			
		||||
        side_identifier = "{:.3} {:.3}".format(author_name.upper(),
 | 
			
		||||
                                               data['title'].upper(),)
 | 
			
		||||
        if data['subtitle']:
 | 
			
		||||
            start = data['subtitle'].split(' ')[0].replace('.', '')
 | 
			
		||||
            print("start:", start)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user