diff --git a/input/models.py b/input/models.py index 3c8b91c..80cd895 100755 --- a/input/models.py +++ b/input/models.py @@ -19,6 +19,19 @@ class TermsConsentMixin(models.Model): abstract = True +class RequestUrlMixin(models.Model): + """ + Abstract mixin for adding an OTRS request URL field to admin models. + + This field stores a direct link to the related OTRS ticket. + Note: OTRS links may contain semicolons, which must not be URL-encoded. + """ + request_url = models.URLField(max_length=2000, null=True, verbose_name='Antrag (URL)') + + class Meta: + abstract = True + + class Volunteer(models.Model): realname = models.CharField(max_length=200, null=True, verbose_name="Realname", help_text="Bitte gib deinen Vornamen und deinen Nachnamen ein.", default='') @@ -244,7 +257,7 @@ def getProjectEnd(sender, instance, **kwargs): # super(Travel, self).save(*args,**kwargs) #abstract base class for Library and IFG -class Grant(Extern): +class Grant(RequestUrlMixin, Extern): cost = models.CharField(max_length=10, verbose_name='Kosten', help_text="Bitte gib die ungefähr zu erwartenden Kosten in Euro an.") notes = models.TextField(max_length=1000, blank=True, verbose_name='Anmerkungen', @@ -361,7 +374,7 @@ DOMAIN_CHOICES = {'PEDIA': '@wikipedia.de', 'SOURCE': '@wikisource.de', 'VERSITY': '@wikiversity.de',} -class Domain(Extern): +class Domain(RequestUrlMixin, Extern): domain = models.CharField(max_length=10, choices=DOMAIN_CHOICES.items(), default='PEDIA') @@ -406,7 +419,7 @@ PROJECT_CHOICE = {'PEDIA': 'Wikipedia', BC_VARIANT = {'PIC': 'mit Bild', 'NOPIC': 'ohne Bild'} -class BusinessCard(TermsConsentMixin, Extern): +class BusinessCard(RequestUrlMixin, TermsConsentMixin, Extern): project = models.CharField(max_length=20, choices=PROJECT_CHOICE.items(), default='PEDIA', verbose_name='Wikimedia-Projekt', help_text='Für welches Wikimedia-Projekt möchtest Du Visitenkarten?')