To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit ad2900f4 authored by Sandro Lutz's avatar Sandro Lutz Committed by Sandro Lutz
Browse files

Improve error message when event signup failed

parent 4338f66b
Pipeline #82881 passed with stages
in 11 minutes and 42 seconds
import React, { useEffect, useState } from 'react'
import PropTypes from 'prop-types'
import { useSelector, useDispatch } from 'react-redux'
import { Parser as HtmlToReactParser } from 'html-to-react'
import { makeStyles } from '@material-ui/styles'
import {
Toolbar,
......@@ -166,7 +165,6 @@ const EventDetails = ({ eventId, ...props }) => {
const { data } = event
const htmlToReactParser = new HtmlToReactParser()
const now = new Date()
const hasOpenRegistration =
data.time_register_start &&
......@@ -188,10 +186,7 @@ const EventDetails = ({ eventId, ...props }) => {
// --------------------
// Prepare notification
if (storedNotification && storedNotification.label) {
notification = {
...storedNotification,
label: htmlToReactParser.parse(storedNotification.label),
}
notification = { ...storedNotification }
} else if (
data.time_register_start &&
now < new Date(data.time_register_start)
......@@ -444,10 +439,12 @@ const EventDetails = ({ eventId, ...props }) => {
})
})
.catch(err => {
const resp = err.response
if (
err.data &&
err.data.message &&
err.data.message.includes('blacklist')
resp.data &&
resp.data._issues &&
resp.data._issues.user &&
resp.data._issues.user.includes('blacklist')
) {
setStoredNotification({
severity: 'error',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment