-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add promo video to form #1292
base: master
Are you sure you want to change the base?
Add promo video to form #1292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix opp i merges, slett og lag heller en enkel istedenfor 3
@@ -701,11 +702,20 @@ class Meta: | |||
|
|||
class RecruitmentSerializer(CustomBaseSerializer): | |||
seperate_positions = RecruitmentSeperatePositionSerializer(many=True, read_only=True) | |||
promo_media = serializers.CharField(max_length=100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tror ikke dette er nødvendig, ettersom det er allerede gjort gjennom at det er et innkludert felt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Det var nødvendig for å tillate input lenger enn 11 characters i api-interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan gjøres i 1 migrasjonsfil :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think i did so?
max_applications: 'max_applications', | ||
promo_media: 'promo_video', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feil navngivning, se toppen av filen
[KEY.max_applications]: 'Max applications per user', | ||
[KEY.promo_media]: "Promo Video", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
liten V?
def validate_promo_media(self, value: str | None) -> str | None: | ||
if (value is None): | ||
return None | ||
match = re.search(r'(youtu.*be.*)\/(watch\?v=|embed\/|v|shorts|)(.*?((?=[&#?])|$))', value) | ||
if (match): | ||
return match.group(3) | ||
raise ValidationError("Invalid youtube url") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvor brukes denne? Bør nok være i recruitment og ikke serializer. Validate blir brukt i andre steder i recruitment model objektet, kan sette dette opp der
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan i samme sleng påkreve kun siste biten av url, og så manuellt legge den til når den vises
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Den kjøres av seg selv, django magic ellerno
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…eate-frontend-for-submitting-and-displaying-recruitment-promo-media
}; | ||
|
||
function youtubeLinkValidator(state: FormType): SamfError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anbefaler å holde komponentfilen ren. Kan flyttes til ./utils.ts
No description provided.